程序包 cn.nukkit.utils
类 Utils
java.lang.Object
cn.nukkit.utils.Utils
- 作者:
- MagicDroidX (Nukkit Project)
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static double
calLinearFunction
(Vector3 pos1, Vector3 pos2, double element, int type) static <T> T[][]
clone2dArray
(T[][] array) static void
static UUID
dataToUUID
(byte[]... params) static UUID
dataToUUID
(String... params) static int
dynamic
(int value) A way to tell the java compiler to do not replace the users of apublic static final int
constant with the value defined in it, forcing the JVM to get the value directly from the class, preventing binary incompatible changes.static <T> T
dynamic
(T value) A way to tell the java compiler to do not replace the users of apublic static final
constant with the value defined in it, forcing the JVM to get the value directly from the class, preventing binary incompatible changes.static String
static String
static Block[]
getLevelBlocks
(Level level, AxisAlignedBB bb) static <T,
U, V> Map<U, V> getOrCreate
(Map<T, Map<U, V>> map, T key) static <T,
U, V extends U>
UgetOrCreate
(Map<T, U> map, Class<V> clazz, T key) static boolean
hasCollisionBlocks
(Level level, AxisAlignedBB bb) static boolean
hasCollisionTickCachedBlocks
(Level level, AxisAlignedBB bb) static boolean
isByteArrayEmpty
(byte[] array) static boolean
static byte[]
static boolean
rand()
static double
rand
(double min, double max) static int
rand
(int min, int max) static String
static String
readFile
(InputStream inputStream) static String
static <T> void
reverseArray
(T[] data) static <T> T[]
reverseArray
(T[] array, boolean copy) static String
static void
static Object[][]
splitArray
(Object[] arrayToSplit, int chunkSize) static long
toABGR
(int argb) static int
static long
toRGB
(byte r, byte g, byte b, byte a) static void
writeFile
(File file, InputStream content) static void
static void
writeFile
(String fileName, InputStream content) static void
static void
-
字段详细资料
-
构造器详细资料
-
Utils
public Utils()
-
-
方法详细资料
-
safeWrite
@PowerNukkitOnly @Since("1.4.0.0-PN") public static void safeWrite(File currentFile, Consumer<File> operation) throws IOException - 抛出:
IOException
-
writeFile
- 抛出:
IOException
-
writeFile
- 抛出:
IOException
-
writeFile
- 抛出:
IOException
-
writeFile
- 抛出:
IOException
-
readFile
- 抛出:
IOException
-
readFile
- 抛出:
IOException
-
readFile
- 抛出:
IOException
-
copyFile
- 抛出:
IOException
-
getAllThreadDumps
-
getExceptionMessage
-
dataToUUID
-
dataToUUID
-
rtrim
-
isByteArrayEmpty
public static boolean isByteArrayEmpty(byte[] array) -
toRGB
public static long toRGB(byte r, byte g, byte b, byte a) -
toABGR
public static long toABGR(int argb) -
splitArray
-
reverseArray
public static <T> void reverseArray(T[] data) -
reverseArray
public static <T> T[] reverseArray(T[] array, boolean copy) -
clone2dArray
public static <T> T[][] clone2dArray(T[][] array) -
getOrCreate
-
getOrCreate
-
toInt
-
parseHexBinary
-
rand
-
rand
-
rand
-
dynamic
A way to tell the java compiler to do not replace the users of apublic static final int
constant with the value defined in it, forcing the JVM to get the value directly from the class, preventing binary incompatible changes.- 参数:
value
- The value to be assigned to the field.- 返回:
- The same value that was passed as parameter
-
dynamic
A way to tell the java compiler to do not replace the users of apublic static final
constant with the value defined in it, forcing the JVM to get the value directly from the class, preventing binary incompatible changes.- 参数:
value
- The value to be assigned to the field.- 返回:
- The same value that was passed as parameter
-
zipFolder
@PowerNukkitOnly @Since("1.4.0.0-PN") public static void zipFolder(Path sourceFolderPath, Path zipPath) throws IOException - 抛出:
IOException
-
isInteger
-
getLevelBlocks
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public static Block[] getLevelBlocks(Level level, AxisAlignedBB bb) -
calLinearFunction
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public static double calLinearFunction(Vector3 pos1, Vector3 pos2, double element, int type) -
hasCollisionBlocks
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public static boolean hasCollisionBlocks(Level level, AxisAlignedBB bb) -
hasCollisionTickCachedBlocks
@PowerNukkitXOnly @Since("1.6.0.0-PNX") public static boolean hasCollisionTickCachedBlocks(Level level, AxisAlignedBB bb)
-