stop iron door from being opened by players not in clan (outpost)
This commit is contained in:
parent
738825ea9d
commit
d25f1abfbf
|
@ -53,6 +53,7 @@ import mineplex.core.updater.UpdateType;
|
||||||
import mineplex.core.updater.event.UpdateEvent;
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.game.clans.clans.ClanInfo;
|
import mineplex.game.clans.clans.ClanInfo;
|
||||||
import mineplex.game.clans.clans.event.ClansWaterPlaceEvent;
|
import mineplex.game.clans.clans.event.ClansWaterPlaceEvent;
|
||||||
|
import mineplex.game.clans.clans.event.IronDoorOpenEvent;
|
||||||
import mineplex.game.clans.clans.event.PlayerClaimTerritoryEvent;
|
import mineplex.game.clans.clans.event.PlayerClaimTerritoryEvent;
|
||||||
import mineplex.game.clans.clans.siege.events.SiegeWeaponExplodeEvent;
|
import mineplex.game.clans.clans.siege.events.SiegeWeaponExplodeEvent;
|
||||||
import mineplex.game.clans.clans.siege.outpost.build.OutpostBlock;
|
import mineplex.game.clans.clans.siege.outpost.build.OutpostBlock;
|
||||||
|
@ -561,6 +562,22 @@ public class Outpost implements Listener
|
||||||
_ownerClan.inform("Your Clan's Outpost has been destroyed.", null);
|
_ownerClan.inform("Your Clan's Outpost has been destroyed.", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void doorOpen(IronDoorOpenEvent event)
|
||||||
|
{
|
||||||
|
if (!UtilAlg.inBoundingBox(event.getBlock().getLocation(), _startCorner.clone().subtract(.5, 0, .5), _endCorner))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_ownerClan.isMember(event.getPlayer()))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onSiegeWeaponExplode(SiegeWeaponExplodeEvent event)
|
public void onSiegeWeaponExplode(SiegeWeaponExplodeEvent event)
|
||||||
{
|
{
|
||||||
|
|
|
@ -68,6 +68,7 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.game.clans.clans.ClanInfo;
|
import mineplex.game.clans.clans.ClanInfo;
|
||||||
import mineplex.game.clans.clans.ClansManager;
|
import mineplex.game.clans.clans.ClansManager;
|
||||||
import mineplex.game.clans.clans.event.ClansWaterPlaceEvent;
|
import mineplex.game.clans.clans.event.ClansWaterPlaceEvent;
|
||||||
|
import mineplex.game.clans.clans.event.IronDoorOpenEvent;
|
||||||
import mineplex.game.clans.core.repository.ClanTerritory;
|
import mineplex.game.clans.core.repository.ClanTerritory;
|
||||||
import mineplex.minecraft.game.classcombat.Class.ClientClass;
|
import mineplex.minecraft.game.classcombat.Class.ClientClass;
|
||||||
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
import mineplex.minecraft.game.classcombat.Class.IPvpClass.ClassType;
|
||||||
|
@ -449,6 +450,13 @@ public class Gameplay extends MiniPlugin
|
||||||
// Open
|
// Open
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
IronDoorOpenEvent customEvent = UtilServer.CallEvent(new IronDoorOpenEvent(event.getPlayer(), block));
|
||||||
|
|
||||||
|
if (customEvent.isCancelled())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (block.getData() >= 8) block = block.getRelative(BlockFace.DOWN);
|
if (block.getData() >= 8) block = block.getRelative(BlockFace.DOWN);
|
||||||
|
|
||||||
if (block.getData() < 4)
|
if (block.getData() < 4)
|
||||||
|
|
Loading…
Reference in New Issue