001 002 import java.util.List; 003 import java.util.Random; 004 005 public class db extends bm { 006 007 public int e = -1; 008 private String h; 009 public double f; 010 public double g = 0.0D; 011 012 public db() { 013 h = "Pig"; 014 e = 20; 015 } 016 017 public void a(String paramString) { 018 h = paramString; 019 } 020 021 public boolean a() { 022 return a.a(b + 0.5D, c + 0.5D, d + 0.5D, 16.0D) != null; 023 } 024 025 public void f() { 026 g = f; 027 028 if (!a()) { 029 return; 030 } 031 032 double d1 = b + a.l.nextFloat(); 033 double d2 = c + a.l.nextFloat(); 034 double d3 = d + a.l.nextFloat(); 035 a.a("smoke", d1, d2, d3, 0.0D, 0.0D, 0.0D); 036 a.a("flame", d1, d2, d3, 0.0D, 0.0D, 0.0D); 037 038 f += 1000.0F / (e + 200.0F); 039 while (f > 360.0D) { 040 f -= 360.0D; 041 g -= 360.0D; 042 } 043 044 if (e == -1) { 045 b(); 046 } 047 048 if (e > 0) { 049 e -= 1; 050 return; 051 } 052 053 int i = 4; 054 for (int j = 0; j < i; j++) { 055 mj localmj = (mj) (mj) jn.a(h, a); 056 if (localmj == null) { 057 return; 058 } 059 060 int k = a.a(localmj.getClass(), fa.b(b, c, d, b + 1, c + 1, d + 1).b(8.0D, 4.0D, 8.0D)).size(); 061 if (k >= 6) { 062 b(); 063 return; 064 } 065 066 if (localmj != null) { 067 double d4 = b + (a.l.nextDouble() - a.l.nextDouble()) * 4.0D; 068 double d5 = c + a.l.nextInt(3) - 1; 069 double d6 = d + (a.l.nextDouble() - a.l.nextDouble()) * 4.0D; 070 071 localmj.c(d4, d5, d6, a.l.nextFloat() * 360.0F, 0.0F); 072 073 if (localmj.b()) { 074 // hMod: allow entities to spawn 075 if ((Boolean) (etc.getLoader().callHook(PluginLoader.Hook.MOB_SPAWN, new Mob(localmj)))) { 076 d(); 077 return; 078 } 079 a.a(localmj); 080 081 for (int m = 0; m < 20; m++) { 082 d1 = b + 0.5D + (a.l.nextFloat() - 0.5D) * 2.0D; 083 d2 = c + 0.5D + (a.l.nextFloat() - 0.5D) * 2.0D; 084 d3 = d + 0.5D + (a.l.nextFloat() - 0.5D) * 2.0D; 085 086 a.a("smoke", d1, d2, d3, 0.0D, 0.0D, 0.0D); 087 a.a("flame", d1, d2, d3, 0.0D, 0.0D, 0.0D); 088 } 089 090 localmj.R(); 091 b(); 092 } 093 } 094 } 095 096 super.f(); 097 } 098 099 private void b() { 100 e = (200 + a.l.nextInt(600)); 101 } 102 103 public void a(ah paramah) { 104 super.a(paramah); 105 h = paramah.h("EntityId"); 106 e = paramah.c("Delay"); 107 } 108 109 public void b(ah paramah) { 110 super.b(paramah); 111 paramah.a("EntityId", h); 112 paramah.a("Delay", (short) e); 113 } 114 }