Don't spawn combat NPCs in the lobby
This commit is contained in:
parent
1fbeaa6ecd
commit
26df99a4cf
@ -6,6 +6,7 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import mineplex.core.recharge.Recharge;
|
||||
import mineplex.gemhunters.death.event.QuitNPCSpawnEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
@ -130,6 +131,17 @@ public class SafezoneModule extends MiniPlugin
|
||||
_currentSafezone.remove(player.getUniqueId());
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void quitNpcSpawn(QuitNPCSpawnEvent event)
|
||||
{
|
||||
String safezone = getSafezone(event.getPlayer().getLocation());
|
||||
|
||||
if (safezone != null && safezone.contains(SAFEZONE_DATA_IGNORE))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void entityDamage(EntityDamageEvent event)
|
||||
{
|
||||
|
@ -77,7 +77,7 @@ public class ShopModule extends MiniPlugin
|
||||
_npcs = new ArrayList<>();
|
||||
_spawnedIndexes = new HashMap<>();
|
||||
|
||||
runSyncLater(() -> updateVillagerTrades(), 20);
|
||||
runSyncLater(this::updateVillagerTrades, 20);
|
||||
}
|
||||
|
||||
public void updateVillagerTrades()
|
||||
@ -111,8 +111,6 @@ public class ShopModule extends MiniPlugin
|
||||
{
|
||||
SlackSheetsBot.reportParsingError(e, "Villager Trades", key, row);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
@ -135,8 +133,6 @@ public class ShopModule extends MiniPlugin
|
||||
{
|
||||
SlackSheetsBot.reportParsingError(e, "Villager Trades", key, row);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user