Skip to content

Flo0/PlayerBlockTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PlayerBlockTracker

This Spigot plugin provides tracking of blocks placed by any player that is not in creative mode in a performant and persistent way.

BlockTrackingIllustration

API methods:

  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)

Example implementation

  @EventHandler
  public void onBreak(final BlockBreakEvent event) {
    final Block brokenBlock = event.getBlock();
    if (PlayerBlockTracker.isTracked(brokenBlock)) {
      event.setCancelled(true);
    }
  }

Maven dependency

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>