Skip to content

Commit

Permalink
fix(android): android will kill ghost now
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Oct 22, 2024
1 parent 401a59c commit ab17dc5
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,16 @@ protected void move(Block b, BlockFace face, Block block) {
return;
}

// Bro encountered a ghost 💀
if (StorageCacheUtils.hasBlock(block.getLocation())) {
var data = StorageCacheUtils.getBlock(block.getLocation());
if (data != null && !data.isPendingRemove()) {
// Since it's a ghost, we just hunt it.
Slimefun.getDatabaseManager().getBlockDataController().removeBlock(block.getLocation());
}
return;
}

block.setBlockData(Material.PLAYER_HEAD.createBlockData(data -> {
if (data instanceof Rotatable rotatable) {
rotatable.setRotation(face.getOppositeFace());
Expand Down

0 comments on commit ab17dc5

Please sign in to comment.