File tree Expand file tree Collapse file tree
src/main/java/io/github/thebusybiscuit/sensibletoolbox/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77import lombok .NonNull ;
88
9+ /**
10+ * A collection of miscellaneous material-related utility methods.
11+ */
912public final class MaterialConverter {
1013 /**
11- * Turn log into sapling preserving tree type
12- *
13- * @param log
14- * log you want to turn into sapling
15- * @return sapling
16- */
14+ * Turn log into sapling preserving tree type
15+ *
16+ * @param log log you want to turn into sapling
17+ * @return sapling
18+ */
1719 public static Optional <Material > getSaplingFromLog (@ NonNull Material log ) {
1820 if (!isLog (log ))
1921 return Optional .empty ();
@@ -26,13 +28,13 @@ public static Optional<Material> getSaplingFromLog(@NonNull Material log) {
2628 return Optional .empty ();
2729 }
2830 }
31+
2932 /**
30- * Turn log into planks preserving tree type
31- *
32- * @param log
33- * log you want to turn into planks
34- * @return planks
35- */
33+ * Turn log into planks preserving tree type
34+ *
35+ * @param log log you want to turn into planks
36+ * @return planks
37+ */
3638 public static Optional <Material > getPlanksFromLog (@ NonNull Material log ) {
3739 if (!isLog (log ))
3840 return Optional .empty ();
@@ -45,13 +47,13 @@ public static Optional<Material> getPlanksFromLog(@NonNull Material log) {
4547 return Optional .empty ();
4648 }
4749 }
50+
4851 /**
49- * Check if material is log (any type)
50- *
51- * @param log
52- * the material to check
53- * @return true if the stack is log; false otherwise
54- */
52+ * Check if material is log (any type)
53+ *
54+ * @param log the material to check
55+ * @return true if the stack is log; false otherwise
56+ */
5557 public static boolean isLog (@ NonNull Material log ) {
5658 return log .name ().endsWith ("_LOG" ) || log .name ().endsWith ("_WOOD" );
5759 }
You can’t perform that action at this time.
0 commit comments