Package net.minecraft.entity

Examples of net.minecraft.entity.WatchableObject


    } else if (par1 > 31) {
      throw new IllegalArgumentException("Data value id is too big with " + par1 + "! (Max is " + 31 + ')');
    } else if (watchedObjects[par1] != null) {
      throw new IllegalArgumentException("Duplicate id value for " + par1 + '!');
    }
    watchedObjects[par1] = new WatchableObject(var3, par1, par2Obj);
    isBlank = false;
  }
View Full Code Here


  /**
   * Add a new object for the DataWatcher to watch, using the specified data type.
   */
  @Override
  public void addObjectByDataType(int par1, int par2) {
    WatchableObject var3 = new WatchableObject(par2, par1, null);
    watchedObjects[par1] = var3;
    isBlank = false;
  }
View Full Code Here

  /**
   * updates an already existing object
   */
  @Override
  public void updateObject(int par1, Object par2Obj) {
    WatchableObject var3 = watchedObjects[par1];

    if (!par2Obj.equals(var3.getObject())) {
      var3.setObject(par2Obj);
      var3.setWatched(true);
      objectChanged = true;
    }
  }
View Full Code Here

   */
  public static void writeObjectsInListToStream(List list, DataOutput dataOutput) {
    try {
      if (list != null) {
        for (final Object aPar0List : list) {
          WatchableObject watchableobject = (WatchableObject) aPar0List;
          writeWatchableObject(dataOutput, watchableobject);
        }
      }

      dataOutput.writeByte(127);
View Full Code Here

          arraylist = new ArrayList();
        }

        int i = (b0 & 224) >> 5;
        int j = b0 & 31;
        WatchableObject watchableobject = null;

        switch (i) {
          case 0:
            watchableobject = new WatchableObject(i, j, dataInput.readByte());
            break;
          case 1:
            watchableobject = new WatchableObject(i, j, dataInput.readShort());
            break;
          case 2:
            watchableobject = new WatchableObject(i, j, dataInput.readInt());
            break;
          case 3:
            watchableobject = new WatchableObject(i, j, dataInput.readFloat());
            break;
          case 4:
            watchableobject = new WatchableObject(i, j, Packet.readString(dataInput, 64));
            break;
          case 5:
            watchableobject = new WatchableObject(i, j, Packet.readItemStack(dataInput));
            break;
          case 6:
            int k = dataInput.readInt();
            int l = dataInput.readInt();
            int i1 = dataInput.readInt();
            watchableobject = new WatchableObject(i, j, new ChunkCoordinates(k, l, i1));
        }

        arraylist.add(watchableobject);
      }
View Full Code Here

TOP

Related Classes of net.minecraft.entity.WatchableObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.