欢迎光临散文网 会员登陆 & 注册

MC Alpha 1.2.3_03Him的代码

2023-07-21 16:03 作者:NJ_DF11-0400  | 我要投稿

话说,这个系列似乎没啥人看啊

不过我还是更新了

上次是个视频,讲到了这些:

herobrine
主界面

那么,我要公开Him的源代码了:

package net.minecraft.src;

import java.util.Random;
import net.minecraft.client.Minecraft;

public class EntityHerobrine extends EntityAnimals implements IMobs {
 private int time;
 
 private boolean nothing;
 
 public int field_4121_a;
 
 public double field_4120_b;
 
 public double field_4127_c;
 
 public double field_4126_d;
 
 private Entity field_4123_g;
 
 private int field_4122_h;
 
 public int field_4125_e;
 
 public int field_4124_f;
 
 private Random rand;
 
 private Minecraft mc;
 
 public EntityHerobrine(Minecraft minecraft, World world) {
   super(world);
   this.nothing = false;
   this.rand = new Random();
   this.field_4121_a = 0;
   this.field_4123_g = null;
   this.field_4122_h = 0;
   this.field_4125_e = 0;
   this.field_4124_f = 0;
   this.mc = minecraft;
   this.field_9333_am = 0.0F;
   this.field_9357_z = "/mob/herobrine.png";
   setSize(0.6F, 1.8F);
   this.field_9304_bm = true;
 }
 
 protected void func_418_b_() {
   this.field_4125_e = this.field_4124_f;
   if (this.field_4123_g != null && this.field_4123_g.isDead)
     this.field_4123_g = null;
   if (this.field_4123_g == null || this.field_4122_h-- <= 0) {
     this.field_4123_g = this.worldObj.getClosestPlayerToEntity(this, 100.0D);
     if (this.field_4123_g != null)
       this.field_4122_h = 20;
   }
   double d4 = 64.0D;
   if (this.field_4123_g != null && this.field_4123_g.getDistanceSqToEntity(this) < d4 * d4) {
     double d5 = this.field_4123_g.posX - this.posX;
     double d6 = this.field_4123_g.boundingBox.minY + (this.field_4123_g.height / 2.0F) - this.posY + (this.height / 2.0F);
     double d7 = this.field_4123_g.posZ - this.posZ;
     this.field_735_n = this.rotationYaw = -((float)Math.atan2(d5, d7)) * 180.0F / 3.141593F;
     if (func_420_c(this.field_4123_g)) {
       this.field_4124_f++;
       if (this.field_4124_f == 20)
         this.field_4124_f = -40;
     } else if (this.field_4124_f > 0) {
       this.field_4124_f--;
     }
   } else {
     this.field_735_n = this.rotationYaw = -((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / 3.141593F;
     if (this.field_4124_f > 0)
       this.field_4124_f--;
   }
 }
 
 private boolean func_4050_a(double d, double d1, double d2, double d3) {
   double d4 = (this.field_4120_b - this.posX) / d3;
   double d5 = (this.field_4127_c - this.posY) / d3;
   double d6 = (this.field_4126_d - this.posZ) / d3;
   AxisAlignedBB axisalignedbb = this.boundingBox.copy();
   for (int i = 1; i < d3; i++) {
     axisalignedbb.offset(d4, d5, d6);
     if (this.worldObj.getCollidingBoundingBoxes(this, axisalignedbb).size() > 0)
       return false;
   }
   return true;
 }
 
 public void func_425_j() {
   super.func_425_j();
   if (this.time == 100) {
     setEntityDead();
   } else {
     this.time++;
   }
   if (this.isDead) {
     if (this.rand.nextInt(2) == 0)
       this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ - 1, Block.torchRedstoneActive.blockID);
     if (this.rand.nextInt(2) == 0)
       this.worldObj.setBlock((int)this.posX, (int)this.posY, (int)this.posZ - 1, Block.redstoneWire.blockID);
     if (this.rand.nextInt(2) == 0)
       this.nothing = true;
   }
 }
 
 protected float func_6393_h() {
   return 0.0F;
 }
 
 public int func_6391_i() {
   return 1;
 }
}

喏,这就是黑幕的真相

咋样,不恐怖吧

MC Alpha 1.2.3_03Him的代码的评论 (共 条)

分享到微博请遵守国家法律