mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Added fail safes against bonus drop meta not being cleaned up
This commit is contained in:
@ -38,6 +38,18 @@ public final class BlockUtils {
|
||||
blockState.setMetadata(MetadataConstants.METADATA_KEY_BONUS_DROPS, new BonusDropMeta(1, mcMMO.p));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set up the state for a block to be seen as unnatural and cleanup any unwanted metadata from the block
|
||||
* @param block target block
|
||||
*/
|
||||
public static void setUnnaturalBlock(@NotNull Block block) {
|
||||
mcMMO.getPlaceStore().setTrue(block);
|
||||
|
||||
// Failsafe against lingering metadata
|
||||
if(block.hasMetadata(MetadataConstants.METADATA_KEY_BONUS_DROPS))
|
||||
block.removeMetadata(MetadataConstants.METADATA_KEY_BONUS_DROPS, mcMMO.p);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up some block metadata when a block breaks and the metadata is no longer needed
|
||||
* This also sets the blocks coords to false in our chunk store
|
||||
|
Reference in New Issue
Block a user