Moves a bunch of inner classes to their own files

This commit is contained in:
2021-02-11 15:53:54 +01:00
parent 56410a58f8
commit 1719e92494
14 changed files with 427 additions and 350 deletions

View File

@ -0,0 +1,35 @@
package net.knarcraft.stargate.utility;
import org.bukkit.Material;
import org.bukkit.Tag;
/**
* This class helps decide properties of materials not already present in the Spigot API
*/
public final class MaterialHelper {
/**
* Checks whether the given material is a dead or alive wall coral
* @param material <p>The material to check</p>
* @return <p>True if the material is a wall coral</p>
*/
public static boolean isWallCoral(Material material) {
return Tag.WALL_CORALS.isTagged(material) ||
material.equals(Material.DEAD_BRAIN_CORAL_WALL_FAN) ||
material.equals(Material.DEAD_BUBBLE_CORAL_WALL_FAN) ||
material.equals(Material.DEAD_FIRE_CORAL_WALL_FAN) ||
material.equals(Material.DEAD_HORN_CORAL_WALL_FAN) ||
material.equals(Material.DEAD_TUBE_CORAL_WALL_FAN);
}
/**
* Checks whether the given material can be used as a button
* @param material <p>The material to check</p>
* @return <p>True if the material can be used as a button</p>
*/
public static boolean isButtonCompatible(Material material) {
return Tag.BUTTONS.isTagged(material) || isWallCoral(material) || Tag.SHULKER_BOXES.isTagged(material) ||
material == Material.CHEST;
}
}