mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 07:06:44 +01:00
Add config options for all paper events.
This commit is contained in:
parent
c6dc9ee189
commit
729469e030
@ -141,6 +141,9 @@ public class PaperListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) {
|
@EventHandler public void onPreCreatureSpawnEvent(PreCreatureSpawnEvent event) {
|
||||||
|
if (!Settings.Paper_Components.CREATURE_SPAWN) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Location location = BukkitUtil.getLocation(event.getSpawnLocation());
|
Location location = BukkitUtil.getLocation(event.getSpawnLocation());
|
||||||
PlotArea area = location.getPlotArea();
|
PlotArea area = location.getPlotArea();
|
||||||
if (!location.isPlotArea()) {
|
if (!location.isPlotArea()) {
|
||||||
@ -245,6 +248,7 @@ public class PaperListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler public void onPreSpawnerSpawnEvent(PreSpawnerSpawnEvent event) {
|
@EventHandler public void onPreSpawnerSpawnEvent(PreSpawnerSpawnEvent event) {
|
||||||
|
if (Settings.Paper_Components.SPAWNER_SPAWN) {
|
||||||
Location location = BukkitUtil.getLocation(event.getSpawnerLocation());
|
Location location = BukkitUtil.getLocation(event.getSpawnerLocation());
|
||||||
PlotArea area = location.getPlotArea();
|
PlotArea area = location.getPlotArea();
|
||||||
if (area != null && !area.isMobSpawnerSpawning()) {
|
if (area != null && !area.isMobSpawnerSpawning()) {
|
||||||
@ -252,6 +256,7 @@ public class PaperListener implements Listener {
|
|||||||
event.setShouldAbortSpawn(true);
|
event.setShouldAbortSpawn(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unsure if this will be any performance improvement over the spigot version,
|
* Unsure if this will be any performance improvement over the spigot version,
|
||||||
@ -260,6 +265,9 @@ public class PaperListener implements Listener {
|
|||||||
* @param event Paper's PlayerLaunchProjectileEvent
|
* @param event Paper's PlayerLaunchProjectileEvent
|
||||||
*/
|
*/
|
||||||
@EventHandler public void onProjectileLaunch(PlayerLaunchProjectileEvent event) {
|
@EventHandler public void onProjectileLaunch(PlayerLaunchProjectileEvent event) {
|
||||||
|
if (!Settings.Paper_Components.PLAYER_PROJECTILE) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Projectile entity = event.getProjectile();
|
Projectile entity = event.getProjectile();
|
||||||
if (!(entity instanceof ThrownPotion)) {
|
if (!(entity instanceof ThrownPotion)) {
|
||||||
return;
|
return;
|
||||||
|
@ -364,6 +364,12 @@ public class Settings extends Config {
|
|||||||
@Comment(
|
@Comment(
|
||||||
"Cancel entity spawns when the chunk is loaded if the PlotArea's mob spawning is off")
|
"Cancel entity spawns when the chunk is loaded if the PlotArea's mob spawning is off")
|
||||||
public static boolean CANCEL_CHUNK_SPAWN = true;
|
public static boolean CANCEL_CHUNK_SPAWN = true;
|
||||||
|
@Comment("Use paper's PlayerLaunchProjectileEvent to cancel projectiles")
|
||||||
|
public static boolean PLAYER_PROJECTILE = true;
|
||||||
|
@Comment("Cancel entity spawns from spawners before they happen (performance buff)")
|
||||||
|
public static boolean SPAWNER_SPAWN = true;
|
||||||
|
@Comment("Cancel entity spawns from tick spawn rates before they happen (performance buff)")
|
||||||
|
public static boolean CREATURE_SPAWN = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user