parent
ec1501bf4f
commit
ddd3150732
File diff suppressed because it is too large
Load Diff
@ -5,6 +5,7 @@ import com.massivecraft.factions.event.PowerLossEvent;
|
|||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
import com.massivecraft.factions.util.MiscUtil;
|
import com.massivecraft.factions.util.MiscUtil;
|
||||||
import com.massivecraft.factions.util.timer.type.GraceTimer;
|
import com.massivecraft.factions.util.timer.type.GraceTimer;
|
||||||
|
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -138,7 +139,7 @@ public class FactionsEntityListener implements Listener {
|
|||||||
// Run the check for a player
|
// Run the check for a player
|
||||||
if (damager instanceof Player) {
|
if (damager instanceof Player) {
|
||||||
|
|
||||||
if (!FactionsBlockListener.playerCanBuildDestroyBlock((Player) damager, damagee.getLocation(), "destroy", false))
|
if (!FactionsBlockListener.playerCanBuildDestroyBlock((Player) damager, damagee.getLocation(), PermissableAction.DESTROY, false))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -508,7 +509,7 @@ public class FactionsEntityListener implements Listener {
|
|||||||
Player p = (Player) e.getRemover();
|
Player p = (Player) e.getRemover();
|
||||||
|
|
||||||
if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType() == EntityType.ITEM_FRAME) {
|
if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType() == EntityType.ITEM_FRAME) {
|
||||||
if (!FactionsBlockListener.playerCanBuildDestroyBlock(p, e.getEntity().getLocation(), "destroy", false)) {
|
if (!FactionsBlockListener.playerCanBuildDestroyBlock(p, e.getEntity().getLocation(), PermissableAction.DESTROY, false)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -519,7 +520,7 @@ public class FactionsEntityListener implements Listener {
|
|||||||
if (e.getPlayer() == null) return;
|
if (e.getPlayer() == null) return;
|
||||||
|
|
||||||
if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType() == EntityType.ITEM_FRAME) {
|
if (e.getEntity().getType() == EntityType.PAINTING || e.getEntity().getType() == EntityType.ITEM_FRAME) {
|
||||||
if (!FactionsBlockListener.playerCanBuildDestroyBlock(e.getPlayer(), e.getBlock().getLocation(), "build", false)) {
|
if (!FactionsBlockListener.playerCanBuildDestroyBlock(e.getPlayer(), e.getBlock().getLocation(), PermissableAction.BUILD, false)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
e.getPlayer().updateInventory();
|
e.getPlayer().updateInventory();
|
||||||
}
|
}
|
||||||
@ -626,7 +627,7 @@ public class FactionsEntityListener implements Listener {
|
|||||||
if (event.getRightClicked() == null) return;
|
if (event.getRightClicked() == null) return;
|
||||||
if (!event.getRightClicked().getType().equals(EntityType.ITEM_FRAME)) return;
|
if (!event.getRightClicked().getType().equals(EntityType.ITEM_FRAME)) return;
|
||||||
|
|
||||||
if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), event.getRightClicked().getLocation(), "build", false)) {
|
if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), event.getRightClicked().getLocation(), PermissableAction.BUILD, false)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -864,7 +864,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getType() == XMaterial.GRASS_BLOCK.parseMaterial()
|
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getType() == XMaterial.GRASS_BLOCK.parseMaterial()
|
||||||
&& event.hasItem() && event.getItem().getType() == XMaterial.BONE_MEAL.parseMaterial()) {
|
&& event.hasItem() && event.getItem().getType() == XMaterial.BONE_MEAL.parseMaterial()) {
|
||||||
if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), block.getLocation(), PermissableAction.BUILD.name(), true)) {
|
if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), block.getLocation(), PermissableAction.BUILD, true)) {
|
||||||
FPlayer me = FPlayers.getInstance().getById(event.getPlayer().getUniqueId().toString());
|
FPlayer me = FPlayers.getInstance().getById(event.getPlayer().getUniqueId().toString());
|
||||||
Faction myFaction = me.getFaction();
|
Faction myFaction = me.getFaction();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user