Class Util
java.lang.Object
dev.jensderuiter.minecraft_imagery.Util
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImageGets an image using the specified name.static BufferedImagegetPlayerSkinBack(org.bukkit.entity.Player player) Puts all backward-facing skin parts together to form a backwards-facing view of the player skin.static BufferedImagegetPlayerSkinFront(org.bukkit.entity.Player player) Puts all front skin parts together to form a front-facing view of the player skin.static StringstackTraceToString(Throwable error) Converts a throwable's stacktrace to a string.
-
Field Details
-
imageCache
-
skinModelCache
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
getImage
Gets an image using the specified name.- Parameters:
name- The name of a block.- Returns:
- An image if found inside the resources/textures/ folder, otherwise null.
-
getPlayerSkinFront
Puts all front skin parts together to form a front-facing view of the player skin. Also caches the skin view indefinitely in memory.- Parameters:
player- The player to get the front skin view from- Returns:
- An image containing the front-facing view of a skin in 16x32 pixels.
-
getPlayerSkinBack
Puts all backward-facing skin parts together to form a backwards-facing view of the player skin. Also caches the skin view indefinitely in memory.- Parameters:
player- The player to get the backwards-facing skin view from- Returns:
- An image containing the backwards-facing view of a skin in 16x32 pixels.
-
stackTraceToString
Converts a throwable's stacktrace to a string. Used for further formatting.- Parameters:
error- The throwable to get the stacktrace from.- Returns:
- The string containing the stacktrace.
-