예제 #1
0
파일: Mob.java 프로젝트: spenk/CanaryMod
  /**
   * Checks to see if the mob is a valid mob
   *
   * @param mob the mob to check
   * @return true of mob is valid
   */
  public static boolean isValid(String mob) {
    if (mob == null) {
      return false;
    }
    OEntity c = OEntityList.a(mob, etc.getServer().getWorld(0).getWorld());

    return c instanceof OIMob || c instanceof OIAnimals;
  }
예제 #2
0
파일: Mob.java 프로젝트: spenk/CanaryMod
 /**
  * Returns this mob's name
  *
  * @return name
  */
 @Override
 public String getName() {
   return OEntityList.b(entity);
 }
예제 #3
0
파일: Mob.java 프로젝트: spenk/CanaryMod
 /**
  * Creates a mob interface
  *
  * @param mob name of the mob
  * @param world World for the mob
  */
 public Mob(String mob, World world) {
   this((OEntityLiving) OEntityList.a(mob, world.getWorld()));
 }
예제 #4
0
파일: Mob.java 프로젝트: spenk/CanaryMod
 /**
  * Creates a mob interface
  *
  * @param mob name of mob
  * @deprecated Use {@link #Mob(java.lang.String, World)} instead.
  */
 public Mob(String mob) {
   this((OEntityLiving) OEntityList.a(mob, etc.getMCServer().a(0)));
 }
예제 #5
0
  private OChunk a(OWorld oworld, ONBTTagCompound onbttagcompound) {
    int i = onbttagcompound.f("xPos");
    int j = onbttagcompound.f("zPos");
    OChunk ochunk = new OChunk(oworld, i, j);

    ochunk.f = onbttagcompound.l("HeightMap");
    ochunk.k = onbttagcompound.o("TerrainPopulated");
    ONBTTagList onbttaglist = onbttagcompound.n("Sections");
    byte b0 = 16;
    OExtendedBlockStorage[] aoextendedblockstorage = new OExtendedBlockStorage[b0];

    for (int k = 0; k < onbttaglist.d(); ++k) {
      ONBTTagCompound onbttagcompound1 = (ONBTTagCompound) onbttaglist.a(k);
      byte b1 = onbttagcompound1.d("Y");
      OExtendedBlockStorage oextendedblockstorage = new OExtendedBlockStorage(b1 << 4);

      oextendedblockstorage.a(onbttagcompound1.k("Blocks"));
      if (onbttagcompound1.c("Add")) {
        oextendedblockstorage.a(new ONibbleArray(onbttagcompound1.k("Add"), 4));
      }

      oextendedblockstorage.b(new ONibbleArray(onbttagcompound1.k("Data"), 4));
      oextendedblockstorage.d(new ONibbleArray(onbttagcompound1.k("SkyLight"), 4));
      oextendedblockstorage.c(new ONibbleArray(onbttagcompound1.k("BlockLight"), 4));
      oextendedblockstorage.d();
      aoextendedblockstorage[b1] = oextendedblockstorage;
    }

    ochunk.a(aoextendedblockstorage);
    if (onbttagcompound.c("Biomes")) {
      ochunk.a(onbttagcompound.k("Biomes"));
    }

    ONBTTagList onbttaglist1 = onbttagcompound.n("Entities");

    if (onbttaglist1 != null) {
      for (int l = 0; l < onbttaglist1.d(); ++l) {
        ONBTTagCompound onbttagcompound2 = (ONBTTagCompound) onbttaglist1.a(l);
        OEntity oentity = OEntityList.a(onbttagcompound2, oworld);

        ochunk.m = true;
        if (oentity != null) {
          ochunk.a(oentity);
        }
      }
    }

    ONBTTagList onbttaglist2 = onbttagcompound.n("TileEntities");

    if (onbttaglist2 != null) {
      for (int i1 = 0; i1 < onbttaglist2.d(); ++i1) {
        ONBTTagCompound onbttagcompound3 = (ONBTTagCompound) onbttaglist2.a(i1);
        OTileEntity otileentity = OTileEntity.c(onbttagcompound3);

        if (otileentity != null) {
          ochunk.a(otileentity);
        }
      }
    }

    if (onbttagcompound.c("TileTicks")) {
      ONBTTagList onbttaglist3 = onbttagcompound.n("TileTicks");

      if (onbttaglist3 != null) {
        for (int j1 = 0; j1 < onbttaglist3.d(); ++j1) {
          ONBTTagCompound onbttagcompound4 = (ONBTTagCompound) onbttaglist3.a(j1);

          oworld.d(
              onbttagcompound4.f("x"),
              onbttagcompound4.f("y"),
              onbttagcompound4.f("z"),
              onbttagcompound4.f("i"),
              onbttagcompound4.f("t"));
        }
      }
    }

    return ochunk;
  }