Makes sure to only remove buttons from always-on portals if the block is a type of button

This commit is contained in:
Kristian Knarvik 2021-11-08 15:16:51 +01:00
parent 901f9c555c
commit 2a17714e8d

View File

@ -295,7 +295,7 @@ public final class PortalFileHelper {
BlockData buttonData = buttonLocation.getBlock().getBlockData();
if (portal.getOptions().isAlwaysOn()) {
//Clear button if not already air or water
if (buttonData.getMaterial() != Material.AIR && buttonData.getMaterial() != Material.WATER) {
if (MaterialHelper.isButtonCompatible(buttonData.getMaterial())) {
Material newMaterial = decideRemovalMaterial(buttonLocation, portal);
Stargate.addBlockChangeRequest(new BlockChangeRequest(buttonLocation, newMaterial, null));
}