Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove some unnecessary limitations on faction's land #1762

Merged
merged 5 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.dansplugins.factionsystem.listener
import com.dansplugins.factionsystem.MedievalFactions
import com.dansplugins.factionsystem.player.MfPlayer
import com.dansplugins.factionsystem.relationship.MfFactionRelationshipType
import org.bukkit.entity.Monster
import org.bukkit.entity.Player
import org.bukkit.entity.Projectile
import org.bukkit.event.EventHandler
Expand Down Expand Up @@ -32,6 +33,7 @@ class EntityDamageByEntityListener(private val plugin: MedievalFactions) : Liste
val damagedFaction = factionService.getFaction(claim.factionId) ?: return
if (!damagedFaction.flags[plugin.flags.enableMobProtection]) return
if (damagerFaction?.id == damagedFaction.id) return
if (damaged is Monster) return
event.isCancelled = true
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ class PlayerInteractListener(private val plugin: MedievalFactions) : Listener {
val claim = claimService.getClaim(clickedBlock.chunk) ?: return
val factionService = plugin.services.factionService
val claimFaction = factionService.getFaction(claim.factionId) ?: return
val item = event.item
if (item != null) {
if (item.type.isEdible && !clickedBlock.type.isInteractable) return
}
if (!claimService.isInteractionAllowed(mfPlayer.id, claim)) {
if (mfPlayer.isBypassEnabled && event.player.hasPermission("mf.bypass")) {
event.player.sendMessage("$RED${plugin.language["FactionTerritoryProtectionBypassed"]}")
Expand Down