Skip to content

Commit

Permalink
remove deprecated api
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed Dec 27, 2023
1 parent 8b184df commit 0fdcdb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
import me.moomoo.anarchyexploitfixes.utils.LogUtils;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.SkullType;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.Skull;

import java.util.HashSet;
import java.util.List;
Expand Down Expand Up @@ -95,12 +93,7 @@ private void run() {
final Material blockType = block.getType();
if (!blocksToRemove.contains(blockType)) continue;

if (blockType.equals(Material.PLAYER_HEAD)) {
Skull skull = (Skull) block.getState();
if (skull.hasOwner() || skull.getSkullType().equals(SkullType.PLAYER)) {
block.setType(Material.AIR, false);
}
} else if (blockType.equals(Material.BEDROCK)) {
if (blockType.equals(Material.BEDROCK)) {
if (y > minY + 4) { // offset to not delete natural bedrock floor
if (inNether) {
// offset to not delete bedrock ceiling
Expand All @@ -109,9 +102,10 @@ private void run() {
block.setType(Material.AIR, false);
}
}
} else {
block.setType(Material.AIR, false);
continue;
}

block.setType(Material.AIR, false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,7 @@ private void onChunkLoad(ChunkLoadEvent event) {
for (int y = minY; y < maxY; y++) {
Block block = chunk.getBlock(x, y, z);
final Material blockType = block.getType();

if (!blocksToRemove.contains(blockType))
continue;

if (blockType.equals(Material.PLAYER_HEAD)) {
block.setType(Material.AIR, false);
continue;
}
if (!blocksToRemove.contains(blockType)) continue;

if (blockType.equals(Material.BEDROCK)) {
if (y > minY+4) { // offset to not delete natural bedrock floor
Expand Down

0 comments on commit 0fdcdb4

Please sign in to comment.