Class HavenBagsPlacementBlocker
java.lang.Object
valorless.valorlessutils.havenbags.HavenBagsPlacementBlocker
- All Implemented Interfaces:
- org.bukkit.event.Listener
A safeguard listener that prevents players from placing "HavenBags" items or skin tokens as blocks
 when the HavenBags plugin is not enabled.  
 
This ensures items that are meant to function only as bags (or special tokens) cannot be placed in the world as normal blocks, which could otherwise corrupt gameplay or break bag functionality.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidinit()Initializes the placement blocker by loading the HavenBags config and registering the event listener.static BooleanIsBag(org.bukkit.inventory.ItemStack item) Checks whether the given item is a HavenBag.static BooleanIsSkinToken(org.bukkit.inventory.ItemStack item) Checks whether the given item is a skin token.voidonBlockPlace(org.bukkit.event.block.BlockPlaceEvent event) Event handler that prevents bag items or skin tokens from being placed as blocks if HavenBags is missing or disabled.
- 
Constructor Details- 
HavenBagsPlacementBlockerpublic HavenBagsPlacementBlocker()
 
- 
- 
Method Details- 
initpublic static void init()Initializes the placement blocker by loading the HavenBags config and registering the event listener. If the config cannot be loaded, the blocker will not activate.
- 
onBlockPlacepublic void onBlockPlace(org.bukkit.event.block.BlockPlaceEvent event) Event handler that prevents bag items or skin tokens from being placed as blocks if HavenBags is missing or disabled. Cancels the block placement if the placed item is recognized as a bag or token.- Parameters:
- event- the block placement event
 
- 
IsBagChecks whether the given item is a HavenBag.- Parameters:
- item- the item to check
- Returns:
- true if the item contains a bag-uuidNBT tag
 
- 
IsSkinTokenChecks whether the given item is a skin token.- Parameters:
- item- the item to check
- Returns:
- true if the item contains a bag-token-skinNBT tag
 
 
-