Skip to content

Instantly share code, notes, and snippets.

@Lanse505
Created March 27, 2020 20:58
Show Gist options
  • Save Lanse505/2150931b21290eb25bbebff0f62dc687 to your computer and use it in GitHub Desktop.
Save Lanse505/2150931b21290eb25bbebff0f62dc687 to your computer and use it in GitHub Desktop.
public void tick() {
this.field_195528_k = this.field_195527_j;
this.field_195530_m = this.field_195529_l;
PlayerEntity lvt_1_1_ = this.world.getClosestPlayer((double)((float)this.pos.getX() + 0.5F), (double)((float)this.pos.getY() + 0.5F), (double)((float)this.pos.getZ() + 0.5F), 3.0D, false);
if (lvt_1_1_ != null) {
double lvt_2_1_ = lvt_1_1_.getPosX() - ((double)this.pos.getX() + 0.5D);
double lvt_4_1_ = lvt_1_1_.getPosZ() - ((double)this.pos.getZ() + 0.5D);
this.field_195531_n = (float)MathHelper.atan2(lvt_4_1_, lvt_2_1_);
this.field_195527_j += 0.1F;
if (this.field_195527_j < 0.5F || field_195532_o.nextInt(40) == 0) {
float lvt_6_1_ = this.field_195525_h;
do {
this.field_195525_h += (float)(field_195532_o.nextInt(4) - field_195532_o.nextInt(4));
} while(lvt_6_1_ == this.field_195525_h);
}
} else {
this.field_195531_n += 0.02F;
this.field_195527_j -= 0.1F;
}
while(this.field_195529_l >= 3.1415927F) {
this.field_195529_l -= 6.2831855F;
}
while(this.field_195529_l < -3.1415927F) {
this.field_195529_l += 6.2831855F;
}
while(this.field_195531_n >= 3.1415927F) {
this.field_195531_n -= 6.2831855F;
}
while(this.field_195531_n < -3.1415927F) {
this.field_195531_n += 6.2831855F;
}
float lvt_2_2_;
for(lvt_2_2_ = this.field_195531_n - this.field_195529_l; lvt_2_2_ >= 3.1415927F; lvt_2_2_ -= 6.2831855F) {
}
while(lvt_2_2_ < -3.1415927F) {
lvt_2_2_ += 6.2831855F;
}
this.field_195529_l += lvt_2_2_ * 0.4F;
this.field_195527_j = MathHelper.clamp(this.field_195527_j, 0.0F, 1.0F);
++this.field_195522_a;
this.field_195524_g = this.field_195523_f;
float lvt_3_1_ = (this.field_195525_h - this.field_195523_f) * 0.4F;
float lvt_4_2_ = 0.2F;
lvt_3_1_ = MathHelper.clamp(lvt_3_1_, -0.2F, 0.2F);
this.field_195526_i += (lvt_3_1_ - this.field_195526_i) * 0.9F;
this.field_195523_f += this.field_195526_i;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment