Hub changes
This commit is contained in:
parent
db90bcc958
commit
97cf02eb37
@ -554,7 +554,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
return;
|
||||
|
||||
//Dont Let Chat Near Spawn!
|
||||
if (UtilMath.offset(GetSpawn(), event.getPlayer().getLocation()) < 4)
|
||||
if (UtilMath.offset2d(GetSpawn(), event.getPlayer().getLocation()) == 0)
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Chat", "You must leave spawn before you can chat!"));
|
||||
event.setCancelled(true);
|
||||
|
@ -14,12 +14,14 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
|
||||
@ -29,10 +31,14 @@ import mineplex.core.common.util.Callback;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilBlock;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilEvent;
|
||||
import mineplex.core.common.util.UtilGear;
|
||||
import mineplex.core.common.util.UtilInv;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilTime;
|
||||
import mineplex.core.common.util.UtilEvent.ActionType;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.gadget.event.GadgetActivateEvent;
|
||||
import mineplex.core.gadget.event.GadgetBlockEvent;
|
||||
@ -181,9 +187,18 @@ public class ParkourManager extends MiniPlugin
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void disallowBlockPlace(BlockPlaceEvent event)
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void disallowBlockPlace(PlayerInteractEvent event)
|
||||
{
|
||||
if (event.getPlayer().getItemInHand() == null)
|
||||
return;
|
||||
|
||||
if (!event.getPlayer().getItemInHand().getType().isBlock())
|
||||
return;
|
||||
|
||||
if (!UtilEvent.isAction(event, ActionType.R_BLOCK))
|
||||
return;
|
||||
|
||||
if (isParkourMode(event.getPlayer()))
|
||||
{
|
||||
event.getPlayer().teleport(Manager.GetSpawn());
|
||||
|
@ -47,7 +47,7 @@ public class VisibilityManager extends MiniPlugin
|
||||
if (player.equals(other))
|
||||
continue;
|
||||
|
||||
if (hideMe || !Manager.getPreferences().Get(other).ShowPlayers || UtilMath.offset(player.getLocation(), Manager.GetSpawn()) < 4 ||
|
||||
if (hideMe || !Manager.getPreferences().Get(other).ShowPlayers || UtilMath.offset2d(player.getLocation(), Manager.GetSpawn()) == 0 ||
|
||||
Manager.GetTutorial().InTutorial(other) || Manager.GetTutorial().InTutorial(player) ||
|
||||
(player.getOpenInventory().getType() != InventoryType.CRAFTING && player.getOpenInventory().getType() != InventoryType.CREATIVE))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user