fixed unbreakable snow in Spleef
This commit is contained in:
@@ -9,6 +9,7 @@ import eu.mhsl.minenet.minigames.world.BlockPallet;
|
||||
import eu.mhsl.minenet.minigames.world.generator.terrain.CircularPlateTerrainGenerator;
|
||||
import net.minestom.server.coordinate.Pos;
|
||||
import net.minestom.server.entity.GameMode;
|
||||
import net.minestom.server.event.player.PlayerBlockBreakEvent;
|
||||
import net.minestom.server.event.player.PlayerMoveEvent;
|
||||
import net.minestom.server.event.player.PlayerStartDiggingEvent;
|
||||
import net.minestom.server.instance.batch.AbsoluteBlockBatch;
|
||||
@@ -77,6 +78,15 @@ public class Spleef extends StatelessGame {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBlockBreak(@NotNull PlayerBlockBreakEvent event) {
|
||||
if(!isRunning) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
setBlock(event.getBlockPosition(), Block.AIR);
|
||||
}
|
||||
|
||||
private void destroyBlock(PlayerStartDiggingEvent event) {
|
||||
if(!isRunning) return;
|
||||
setBlock(event.getBlockPosition(), Block.AIR);
|
||||
|
Reference in New Issue
Block a user