This Spigot plugin provides tracking of blocks placed by any player that is not in creative mode in a performant and persistent way.
boolean > PlayerBlockTracker.isTrackedBlock(org.bukkit.Block)
void > PlayerBlockTracker.track(org.bukkit.Block)
void > PlayerBlockTracker.unTrack(org.bukkit.Block)
void > PlayerBlockTracker.moveTrack(org.bukkit.Block, org.bukkit.Block)
@EventHandler
public void onBreak(final BlockBreakEvent event) {
final Block brokenBlock = event.getBlock();
if (PlayerBlockTracker.isTracked(brokenBlock)) {
event.setCancelled(true);
}
}
Repository
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
Dependency
<dependency>
<groupId>com.github.Flo0</groupId>
<artifactId>PlayerBlockTracker</artifactId>
<version>1.0.1</version>
</dependency>