mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-12-27 11:07:49 +01:00
Workaround fix for half-step placement on existing half-steps not being prevented; it's caused by a CraftBukkit bug:
https://bukkit.atlassian.net/browse/BUKKIT-646 Fix for a potential NPE in FPlayer autoLeaveOnInactivityRoutine. Added CaptureThePoints and CombatTag to our softdepend list so they can potentially cancel Factions commands.
This commit is contained in:
parent
c735aea721
commit
84b6278529
@ -1,8 +1,8 @@
|
|||||||
name: Factions
|
name: Factions
|
||||||
version: 1.6.3
|
version: 1.6.4_dev
|
||||||
main: com.massivecraft.factions.P
|
main: com.massivecraft.factions.P
|
||||||
authors: [Olof Larsson, Brett Flannigan]
|
authors: [Olof Larsson, Brett Flannigan]
|
||||||
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard]
|
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, CaptureThePoints, CombatTag]
|
||||||
commands:
|
commands:
|
||||||
factions:
|
factions:
|
||||||
description: Reference command for Factions.
|
description: Reference command for Factions.
|
||||||
|
@ -67,7 +67,11 @@ public class FPlayers extends PlayerEntityCollection<FPlayer>
|
|||||||
|
|
||||||
// if player is faction admin, sort out the faction since he's going away
|
// if player is faction admin, sort out the faction since he's going away
|
||||||
if (fplayer.getRole() == Role.ADMIN)
|
if (fplayer.getRole() == Role.ADMIN)
|
||||||
|
{
|
||||||
|
Faction faction = fplayer.getFaction();
|
||||||
|
if (faction != null)
|
||||||
fplayer.getFaction().promoteNewLeader();
|
fplayer.getFaction().promoteNewLeader();
|
||||||
|
}
|
||||||
|
|
||||||
fplayer.leave(false);
|
fplayer.leave(false);
|
||||||
fplayer.detach();
|
fplayer.detach();
|
||||||
|
@ -8,12 +8,12 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
import org.bukkit.event.player.PlayerBucketEmptyEvent;
|
||||||
import org.bukkit.event.player.PlayerBucketFillEvent;
|
import org.bukkit.event.player.PlayerBucketFillEvent;
|
||||||
import org.bukkit.event.player.PlayerChatEvent;
|
import org.bukkit.event.player.PlayerChatEvent;
|
||||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.event.player.PlayerKickEvent;
|
import org.bukkit.event.player.PlayerKickEvent;
|
||||||
@ -326,6 +326,25 @@ public class FactionsPlayerListener extends PlayerListener
|
|||||||
return; // only interested on right-clicks for below
|
return; // only interested on right-clicks for below
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// workaround fix for new CraftBukkit 1.1-R1 bug where half-step on half-step placement doesn't trigger BlockPlaceEvent
|
||||||
|
if (
|
||||||
|
event.hasItem()
|
||||||
|
&&
|
||||||
|
event.getItem().getType() == Material.STEP
|
||||||
|
&&
|
||||||
|
block.getType() == Material.STEP
|
||||||
|
&&
|
||||||
|
event.getBlockFace() == BlockFace.UP
|
||||||
|
&&
|
||||||
|
event.getItem().getData().getData() == block.getData()
|
||||||
|
&&
|
||||||
|
! FactionsBlockListener.playerCanBuildDestroyBlock(player, block.getLocation(), "build", false)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false))
|
if ( ! playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user