Skip to content

Instantly share code, notes, and snippets.

@ben7th
Last active December 21, 2019 15:36
Show Gist options
  • Select an option

  • Save ben7th/d8afeb8bb987b48f56f64c0b47fd51fc to your computer and use it in GitHub Desktop.

Select an option

Save ben7th/d8afeb8bb987b48f56f64c0b47fd51fc to your computer and use it in GitHub Desktop.
public class aap extends um {
private static final Logger b = ;
public float a = (float) (Math.random() * 3.141592653589793D * 2.0D);
private int c;
private int d;
private int e = 5;
private String f;
private String g;
public aap(amp paramamp, double paramDouble1, double paramDouble2, double paramDouble3) {
super(paramamp);
a(0.25F, 0.25F);
b(paramDouble1, paramDouble2, paramDouble3);
this.y = ((float) (Math.random() * 360.0D));
this.v = ((float) (Math.random() * 0.2000000029802322D - 0.1000000014901161D));
this.w = 0.2000000029802322D;
this.x = ((float) (Math.random() * 0.2000000029802322D - 0.1000000014901161D));
}
public aap(amp paramamp, double paramDouble1, double paramDouble2, double paramDouble3, aio paramaio) {
this(paramamp, paramDouble1, paramDouble2, paramDouble3);
a(paramaio);
}
public aap(amp paramamp) {
super(paramamp);
a(0.25F, 0.25F);
a(new aio(apg.a, 0));
}
protected boolean q_() {
return false;
}
protected void g() {
F().a(10, 5);
}
public void j() {
if (k() == null) {
H();
return;
}
super.j();
if ((this.d > 0) && (this.d != 32767)) {
this.d -= 1;
}
this.p = this.s;
this.q = this.t;
this.r = this.u;
this.w -= 0.03999999910593033D;
this.T = j(this.s, (aL().b + aL().e) / 2.0D, this.u);
d(this.v, this.w, this.x);
int i = ((int) this.p != (int) this.s) || ((int) this.q != (int) this.t) || ((int) this.r != (int) this.u) ? 1 : 0;
if ((i != 0) || (this.W % 25 == 0)) {
if (this.o.p(new dl(this)).c().r() == big.i) {
this.w = 0.2000000029802322D;
this.v = ((this.V.nextFloat() - this.V.nextFloat()) * 0.2F);
this.x = ((this.V.nextFloat() - this.V.nextFloat()) * 0.2F);
a("random.fizz", 0.4F, 2.0F + this.V.nextFloat() * 0.4F);
}
if (!this.o.C) {
v();
}
}
float f1 = 0.98F;
if (this.C) {
f1 = this.o.p(new dl(sr.c(this.s), sr.c(aL().b) - 1, sr.c(this.u))).c().K * 0.98F;
}
this.v *= f1;
this.w *= 0.9800000190734863D;
this.x *= f1;
if (this.C) {
this.w *= -0.5D;
}
if (this.c != -32768) {
this.c += 1;
}
if ((!this.o.C) && (this.c >= 6000)) {
H();
}
}
private void v() {
for (aap localaap : this.o.a(aap.class, aL().b(0.5D, 0.0D, 0.5D))) {
a(localaap);
}
}
private boolean a(aap paramaap) {
if (paramaap == this) {
return false;
}
if ((!paramaap.ad()) || (!ad())) {
return false;
}
aio localaio1 = k();
aio localaio2 = paramaap.k();
if ((this.d == 32767) || (paramaap.d == 32767)) {
return false;
}
if ((this.c == -32768) || (paramaap.c == -32768)) {
return false;
}
if (localaio2.b() != localaio1.b()) {
return false;
}
if ((localaio2.n() ^ localaio1.n())) {
return false;
}
if ((localaio2.n()) && (!localaio2.o().equals(localaio1.o()))) {
return false;
}
if (localaio2.b() == null) {
return false;
}
if ((localaio2.b().k()) && (localaio2.i() != localaio1.i())) {
return false;
}
if (localaio2.b < localaio1.b) {
return paramaap.a(this);
}
if (localaio2.b + localaio1.b > localaio2.c()) {
return false;
}
localaio2.b += localaio1.b;
paramaap.d = Math.max(paramaap.d, this.d);
paramaap.c = Math.min(paramaap.c, this.c);
paramaap.a(localaio2);
H();
return true;
}
public void i() {
this.c = 4800;
}
public boolean T() {
return this.o.a(aL(), big.h, this);
}
protected void f(int paramInt) {
a(ua.a, paramInt);
}
public boolean a(ua paramua, float paramFloat) {
if (b(paramua)) {
return false;
}
if ((k() != null) && (k().b() == aip.bU) && (paramua.c())) {
return false;
}
X();
this.e = ((int) (this.e - paramFloat));
if (this.e <= 0) {
H();
}
return false;
}
public void b(eu parameu) {
parameu.a("Health", (short) (byte) this.e);
parameu.a("Age", (short) this.c);
parameu.a("PickupDelay", (short) this.d);
if (m() != null) {
parameu.a("Thrower", this.f);
}
if (l() != null) {
parameu.a("Owner", this.g);
}
if (k() != null) {
parameu.a("Item", k().b(new eu()));
}
}
public void a(eu parameu) {
this.e = (parameu.e("Health") & 0xFF);
this.c = parameu.e("Age");
if (parameu.c("PickupDelay")) {
this.d = parameu.e("PickupDelay");
}
if (parameu.c("Owner")) {
this.g = parameu.j("Owner");
}
if (parameu.c("Thrower")) {
this.f = parameu.j("Thrower");
}
eu localeu = parameu.m("Item");
a(aio.a(localeu));
if (k() == null) {
H();
}
}
public void d(adq paramadq) {
if (this.o.C) {
return;
}
aio localaio = k();
int i = localaio.b;
if ((this.d == 0) && ((this.g == null) || (6000 - this.c <= 200) || (this.g.equals(paramadq.b_()))) && (paramadq.bg.a(localaio))) {
if (localaio.b() == ahw.a(apg.r)) {
paramadq.b(rl.g);
}
if (localaio.b() == ahw.a(apg.s)) {
paramadq.b(rl.g);
}
if (localaio.b() == aip.aA) {
paramadq.b(rl.t);
}
if (localaio.b() == aip.i) {
paramadq.b(rl.w);
}
if (localaio.b() == aip.bq) {
paramadq.b(rl.A);
}
if ((localaio.b() == aip.i) && (m() != null)) {
adq localadq = this.o.a(m());
if ((localadq != null) && (localadq != paramadq)) {
localadq.b(rl.x);
}
}
this.o.a(paramadq, "random.pop", 0.2F, ((this.V.nextFloat() - this.V.nextFloat()) * 0.7F + 1.0F) * 2.0F);
paramadq.a(this, i);
if (localaio.b <= 0) {
H();
}
}
}
public String b_() {
if (i_()) {
return aG();
}
return eq.a("item." + k().a());
}
public boolean az() {
return false;
}
public void c(int paramInt) {
super.c(paramInt);
if (!this.o.C) {
v();
}
}
public aio k() {
aio localaio = F().f(10);
if (localaio == null) {
if (this.o != null) {
b.error("Item entity " + D() + " has no item?!");
}
return new aio(apg.b);
}
return localaio;
}
public void a(aio paramaio) {
F().b(10, paramaio);
F().h(10);
}
public String l() {
return this.g;
}
public void a(String paramString) {
this.g = paramString;
}
public String m() {
return this.f;
}
public void c(String paramString) {
this.f = paramString;
}
public void o() {
this.d = 10;
}
public void p() {
this.d = 0;
}
public void q() {
this.d = 32767;
}
public void a(int paramInt) {
this.d = paramInt;
}
public boolean r() {
return this.d > 0;
}
public void t() {
this.c = -6000;
}
public void u() {
q();
this.c = 5999;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment