Package com.comphenix.protocol.reflect

Examples of com.comphenix.protocol.reflect.FieldAccessException


    }
    if (type == null) {
      try {
        type = NbtType.getTypeFromID((Byte) methodGetTypeID.invoke(handle));
      } catch (Exception e) {
        throw new FieldAccessException("Cannot get NBT type of " + handle, e);
      }
    }
   
    return type;
  }
View Full Code Here


    }
   
    try {
      return NbtFactory.fromNMS(methodClone.invoke(handle), getName());
    } catch (Exception e) {
      throw new FieldAccessException("Unable to clone " + handle, e);
    }
  }
View Full Code Here

      else
        return createTagSetName(type, name);
     
    } catch (Exception e) {
      // Inform the caller
      throw new FieldAccessException(
          String.format("Cannot create NBT element %s (type: %s)", name, type),
          e);
    }
  }
View Full Code Here

    } else {
      try {
        // Wrap exceptions
        return (Boolean) isMinecraftAsync.invoke(event.getPacket().getHandle());
      } catch (IllegalArgumentException e) {
        throw new FieldAccessException("Illegal argument", e);
      } catch (IllegalAccessException e) {
        throw new FieldAccessException("Unable to reflect method call 'a_', or: isAsyncPacket.", e);
      } catch (InvocationTargetException e) {
        throw new FieldAccessException("Minecraft error", e);
      }
    }
  }
View Full Code Here

    }
   
    try {
      methodWrite.invoke(null, NbtFactory.fromBase(value).getHandle(), destination);
    } catch (Exception e) {
      throw new FieldAccessException("Unable to write NBT " + value, e);
    }
  }
View Full Code Here

    }
   
    try {
      return NbtFactory.fromNMS(method.loadNbt(source), null);
    } catch (Exception e) {
      throw new FieldAccessException("Unable to read NBT from " + source, e);
    }
  }
View Full Code Here

      if (types.length == 1 && match.isMatch(types[0], null)) {
        try {
          Object result = method.invoke(null, trove);
         
          if (result == null)
            throw new FieldAccessException("Wrapper returned NULL.");
          else
            return result;
         
        } catch (IllegalArgumentException e) {
          throw new FieldAccessException("Cannot invoke wrapper method.", e);
        } catch (IllegalAccessException e) {
          throw new FieldAccessException("Illegal access.", e);
        } catch (InvocationTargetException e) {
          throw new FieldAccessException("Error in invocation.", e);
        }
      }
    }
   
    throw new IllegalArgumentException("Cannot find decorator for " + trove + " (" + trove.getClass() + ")");
View Full Code Here

          CREATE_KEY_VALUE_METHOD.invoke(handle, index, WrappedWatchableObject.getUnwrapped(newValue));
        }
       
        // Handle invoking the method
      } catch (IllegalArgumentException e) {
        throw new FieldAccessException("Cannot convert arguments.", e);
    } catch (IllegalAccessException e) {
      throw new FieldAccessException("Illegal access.", e);
    } catch (InvocationTargetException e) {
      throw new FieldAccessException("Checked exception in Minecraft.", e);
    } finally {
        writeLock.unlock();
      }
    }
View Full Code Here

      // We use the get-method first and foremost
      if (GET_KEY_VALUE_METHOD != null) {
      try {
        return GET_KEY_VALUE_METHOD.invoke(handle, index);
      } catch (Exception e) {
        throw new FieldAccessException("Cannot invoke get key method for index " + index, e);
      }
      } else {
        try {
          getReadWriteLock().readLock().lock();
          return getWatchableObjectMap().get(index);
View Full Code Here

        else if (READ_WRITE_LOCK_FIELD != null)
          return readWriteLock = (ReadWriteLock) FieldUtils.readField(READ_WRITE_LOCK_FIELD, handle, true);
        else
          return readWriteLock = new ReentrantReadWriteLock();
      } catch (IllegalAccessException e) {
        throw new FieldAccessException("Unable to read lock field.", e);
      }
    }
View Full Code Here

TOP

Related Classes of com.comphenix.protocol.reflect.FieldAccessException

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.