/** * Construct a wrapper around a given NMS IntHashMap. * @param handle - the NMS IntHashMap. * @return The created wrapped. * @throws IllegalArgumentException If the handle is not an IntHasMap. */ public static WrappedIntHashMap fromHandle(@Nonnull Object handle) { return new WrappedIntHashMap(handle); }
/** * Construct a new IntHashMap. * @return A new IntHashMap. */ public static WrappedIntHashMap newMap() { try { return new WrappedIntHashMap(MinecraftReflection.getIntHashMapClass().newInstance()); } catch (Exception e) { throw new RuntimeException("Unable to construct IntHashMap.", e); } }