feat: add concrete-harden flag (#4184)

This commit is contained in:
Jordan
2023-10-04 09:41:47 +01:00
committed by GitHub
parent 26c55a318f
commit 5f7bb784f0
4 changed files with 49 additions and 0 deletions

View File

@ -33,6 +33,7 @@ import com.plotsquared.core.plot.PlotArea;
import com.plotsquared.core.plot.flag.implementations.BlockBurnFlag;
import com.plotsquared.core.plot.flag.implementations.BlockIgnitionFlag;
import com.plotsquared.core.plot.flag.implementations.BreakFlag;
import com.plotsquared.core.plot.flag.implementations.ConcreteHardenFlag;
import com.plotsquared.core.plot.flag.implementations.CoralDryFlag;
import com.plotsquared.core.plot.flag.implementations.CropGrowFlag;
import com.plotsquared.core.plot.flag.implementations.DisablePhysicsFlag;
@ -586,6 +587,12 @@ public class BlockEventListener implements Listener {
event.setCancelled(true);
}
}
if (event.getNewState().getType().toString().endsWith("CONCRETE")) {
if (!plot.getFlag(ConcreteHardenFlag.class)) {
plot.debug("Concrete powder could not harden because concrete-harden = false");
event.setCancelled(true);
}
}
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)