Makes it easier to use any compatible block as a button

This commit is contained in:
2021-02-10 03:29:28 +01:00
parent 7b9f5a6de5
commit 095e59c65e
5 changed files with 25 additions and 7 deletions

View File

@ -6,7 +6,6 @@ import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.Tag;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.EndGateway;
@ -846,7 +845,7 @@ public class Stargate extends JavaPlugin {
// Handle keeping portal material and buttons around
if (block.getType() == Material.NETHER_PORTAL) {
portal = Portal.getByEntrance(block);
} else if (Tag.BUTTONS.isTagged(block.getType()) || MaterialHelper.isWallCoral(block.getType())) {
} else if (MaterialHelper.isButtonCompatible(block.getType())) {
portal = Portal.getByControl(block);
}
if (portal != null) event.setCancelled(true);