/** * Get a watched short. * * @param index - index of the watched short. * @return The watched short, or NULL if this value doesn't exist. */ public Short getShort(int index) { return (Short) getObject(index); }
/** * Get a watched byte. * * @param index - index of the watched byte. * @return The watched byte, or NULL if this value doesn't exist. */ public Byte getByte(int index) { return (Byte) getObject(index); }
/** * Get a watched string. * * @param index - index of the watched string. * @return The watched string, or NULL if this value doesn't exist. */ public WrappedChunkCoordinate getChunkCoordinate(int index) { return (WrappedChunkCoordinate) getObject(index); }
/** * Whether or not this DataWatcher has an object at a given index. * * @param index Index to check for * @return True if it does, false if not */ public boolean hasIndex(int index) { return getObject(index) != null; }
/** * Get a watched integer. * * @param index - index of the watched integer. * @return The watched integer, or NULL if this value doesn't exist. */ public Integer getInteger(int index) { return (Integer) getObject(index); }
/** * Get a watched string. * * @param index - index of the watched string. * @return The watched string, or NULL if this value doesn't exist. */ public String getString(int index) { return (String) getObject(index); }
/** * Get a watched float. * * @param index - index of the watched float. * @return The watched float, or NULL if this value doesn't exist. */ public Float getFloat(int index) { return (Float) getObject(index); }
/** * Get a watched string. * * @param index - index of the watched string. * @return The watched string, or NULL if this value doesn't exist. */ public ItemStack getItemStack(int index) { return (ItemStack) getObject(index); }
/** * Retrieve a watchable object by index. * * @param index Index of the object to retrieve. * @return The watched object or null if it doesn't exist. */ public Object getObject(int index) { return getObject(WrappedDataWatcherObject.fromIndex(index)); }