package net.piratjsk.sddls.mount;

import net.piratjsk.sddls.saddle.SignedSaddle;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.AbstractHorse;
import org.bukkit.inventory.ItemStack;

public class ProtectedHorse extends GenericMount {

    private final SignedSaddle saddle;

    public ProtectedHorse(final AbstractHorse horse) {
        super(horse);
        final ItemStack saddleItem = horse.getInventory().getSaddle();
        this.saddle = SignedSaddle.fromItemStack(saddleItem);
    }

    @Override
    public SignedSaddle getSaddle() {
        return this.saddle;
    }

    @Override
    public boolean isProtectedFromEnvironment() {
        if (!this.isSaddled()) return false;
        if (!this.saddle.isSigned()) return false;
        return this.hasPassenger();
    }

    @Override
    public boolean isProtectedFromPlayer(final OfflinePlayer player) {
        if (!this.isSaddled()) return false;
        return this.saddle.isSignedBy(player);
    }

    @Override
    public boolean isSaddled() {
        return this.saddle != null;
    }
}

@@ -781,24 +781,25 @@
      return 
+!
 this.hasPass
@@ -950,39 +950,138 @@
 false;%0D%0A        
-return 
+if (player.isOnline() && player.getPlayer().hasPermission(%22sddls.bypass%22)) return false;%0D%0A        return !
 this.saddle.isSi

fix horse protection