예제 #1
0
  protected ChatHoverable aP() {
    NBTTagCompound nbttagcompound = new NBTTagCompound();
    String s = EntityTypes.b(this);

    nbttagcompound.setString("id", this.getUniqueID().toString());
    if (s != null) {
      nbttagcompound.setString("type", s);
    }

    nbttagcompound.setString("name", this.getName());
    return new ChatHoverable(
        EnumHoverAction.SHOW_ENTITY, new ChatComponentText(nbttagcompound.toString()));
  }
예제 #2
0
  public String getName() {
    if (this.hasCustomName()) {
      return this.getCustomName();
    } else {
      String s = EntityTypes.b(this);

      if (s == null) {
        s = "generic";
      }

      return LocaleI18n.get("entity." + s + ".name");
    }
  }
예제 #3
0
  public void c(int i) {
    if (!this.world.isStatic && !this.dead) {
      this.world.methodProfiler.a("changeDimension");
      MinecraftServer minecraftserver = MinecraftServer.getServer();
      int j = this.dimension;
      WorldServer worldserver = minecraftserver.getWorldServer(j);
      WorldServer worldserver1 = minecraftserver.getWorldServer(i);

      this.dimension = i;
      if (j == 1 && i == 1) {
        worldserver1 = minecraftserver.getWorldServer(0);
        this.dimension = 0;
      }

      this.world.kill(this);
      this.dead = false;
      this.world.methodProfiler.a("reposition");
      minecraftserver.getPlayerList().changeWorld(this, j, worldserver, worldserver1);
      this.world.methodProfiler.c("reloading");
      Entity entity = EntityTypes.createEntityByName(EntityTypes.b(this), worldserver1);

      if (entity != null) {
        entity.n(this);
        if (j == 1 && i == 1) {
          BlockPosition blockposition = this.world.r(worldserver1.getSpawn());

          entity.setPositionRotation(blockposition, entity.yaw, entity.pitch);
        }

        worldserver1.addEntity(entity);
      }

      this.dead = true;
      this.world.methodProfiler.b();
      worldserver.j();
      worldserver1.j();
      this.world.methodProfiler.b();
    }
  }
예제 #4
0
 protected final String ag() {
   return EntityTypes.b(this);
 }