-
-
Save loordgek/6e53804a6c5113f73d0dfc3c0da3d376 to your computer and use it in GitHub Desktop.
Error on setupdecompworkspace
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################# | |
ForgeGradle 2.2-SNAPSHOT-f0ba31b | |
https://github.com/MinecraftForge/ForgeGradle | |
################################################# | |
Powered by MCP unknown | |
http://modcoderpack.com | |
by: Searge, ProfMobius, Fesh0r, | |
R4wk, ZeuX, IngisKahn, bspkrs | |
################################################# | |
:deobfCompileDummyTask | |
:deobfProvidedDummyTask | |
:getVersionJson | |
:extractUserdev | |
Download http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.12-14.21.1.2387/forge-1.12-14.21.1.2387.pom | |
Download http://files.minecraftforge.net/maven/net/minecraftforge/forge/1.12-14.21.1.2387/forge-1.12-14.21.1.2387-userdev.jar | |
:extractDependencyATs SKIPPED | |
:extractMcpData | |
Download http://files.minecraftforge.net/maven/de/oceanlabs/mcp/mcp/1.12/mcp-1.12-srg.zip | |
:extractMcpMappings | |
Download http://files.minecraftforge.net/maven/de/oceanlabs/mcp/mcp_snapshot/20170630-1.12/mcp_snapshot-20170630-1.12.zip | |
:genSrgs | |
:downloadClient | |
:downloadServer | |
:splitServerJar | |
:mergeJars | |
:deobfMcSRG | |
Applying SpecialSource... | |
Applying Exceptor... | |
:decompileMc | |
Download https://libraries.minecraft.net/com/mojang/patchy/1.1/patchy-1.1.pom | |
Download https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.4.0/jna-4.4.0.pom | |
Download https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.pom | |
Download https://repo1.maven.org/maven2/io/netty/netty-all/4.1.9.Final/netty-all-4.1.9.Final.pom | |
Download https://repo1.maven.org/maven2/io/netty/netty-parent/4.1.9.Final/netty-parent-4.1.9.Final.pom | |
Download https://repo1.maven.org/maven2/com/google/guava/guava/21.0/guava-21.0.pom | |
Download https://repo1.maven.org/maven2/com/google/guava/guava-parent/21.0/guava-parent-21.0.pom | |
Download https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.pom | |
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/41/commons-parent-41.pom | |
Download https://repo1.maven.org/maven2/org/apache/apache/18/apache-18.pom | |
Download https://repo1.maven.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.pom | |
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/39/commons-parent-39.pom | |
Download https://repo1.maven.org/maven2/org/apache/apache/16/apache-16.pom | |
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10.pom | |
Download https://repo1.maven.org/maven2/org/apache/commons/commons-parent/35/commons-parent-35.pom | |
Download https://repo1.maven.org/maven2/org/apache/apache/15/apache-15.pom | |
Download https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.0/gson-2.8.0.pom | |
Download https://repo1.maven.org/maven2/com/google/code/gson/gson-parent/2.8.0/gson-parent-2.8.0.pom | |
Download https://libraries.minecraft.net/com/mojang/authlib/1.5.25/authlib-1.5.25.pom | |
Download https://libraries.minecraft.net/com/mojang/realms/1.10.17/realms-1.10.17.pom | |
Download https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/7.1.0/fastutil-7.1.0.pom | |
Download https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.8.1/log4j-api-2.8.1.pom | |
Download https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j/2.8.1/log4j-2.8.1.pom | |
Download https://repo1.maven.org/maven2/org/apache/logging/logging-parent/1/logging-parent-1.pom | |
Download https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.8.1/log4j-core-2.8.1.pom | |
Download https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3.pom | |
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.2/asm-debug-all-5.2.pom | |
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-parent/5.2/asm-parent-5.2.pom | |
Download https://repo1.maven.org/maven2/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.pom | |
Download https://libraries.minecraft.net/com/mojang/patchy/1.1/patchy-1.1.jar | |
Download https://repo1.maven.org/maven2/net/java/dev/jna/jna/4.4.0/jna-4.4.0.jar | |
Download https://repo1.maven.org/maven2/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.jar | |
Download https://repo1.maven.org/maven2/io/netty/netty-all/4.1.9.Final/netty-all-4.1.9.Final.jar | |
Download https://repo1.maven.org/maven2/com/google/guava/guava/21.0/guava-21.0.jar | |
Download https://repo1.maven.org/maven2/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar | |
Download https://repo1.maven.org/maven2/commons-io/commons-io/2.5/commons-io-2.5.jar | |
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10.jar | |
Download https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar | |
Download https://libraries.minecraft.net/com/mojang/authlib/1.5.25/authlib-1.5.25.jar | |
Download https://libraries.minecraft.net/com/mojang/realms/1.10.17/realms-1.10.17.jar | |
Download https://repo1.maven.org/maven2/it/unimi/dsi/fastutil/7.1.0/fastutil-7.1.0.jar | |
Download https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.8.1/log4j-api-2.8.1.jar | |
Download https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.8.1/log4j-core-2.8.1.jar | |
Download https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3.jar | |
Download https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.2/asm-debug-all-5.2.jar | |
Download https://repo1.maven.org/maven2/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar | |
: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) { | |
- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment