Skip to content

Commit

Permalink
Fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
illa4257 committed Sep 4, 2023
1 parent af6b61f commit ef4d620
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.spigotmc.event.entity.EntityDismountEvent;

public class OpenSitListener implements Listener {
Expand Down Expand Up @@ -43,6 +44,13 @@ public void onInteract(final PlayerInteractEvent event) {
}
}

@EventHandler
public void onPlayerJoin(final PlayerJoinEvent event) {
final Entity e = event.getPlayer().getVehicle();
if (e instanceof BlockDisplay && (e.getScoreboardTags().contains("sit") || e.getScoreboardTags().contains("sit2")) &&!e.getLocation().getBlock().isSolid())
e.remove();
}

@EventHandler
public void onBreakBlock(final BlockBreakEvent event) {
final Block b = event.getBlock();
Expand Down

0 comments on commit ef4d620

Please sign in to comment.