2018-08-27 02:11:49 +08:00
|
|
|
From 92f50e4fd12ec1dd767f7aae96d08be76115976d Mon Sep 17 00:00:00 2001
|
2018-01-15 06:36:24 +08:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sun, 14 Jan 2018 17:36:02 -0500
|
|
|
|
Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent
|
|
|
|
|
|
|
|
This event can be used for when you want to exclude a certain player
|
|
|
|
from triggering monster spawns on a server.
|
|
|
|
|
|
|
|
Also a highly more effecient way to blanket block spawns in a world
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
2018-08-27 02:11:49 +08:00
|
|
|
index 4a2153b68f..32808558bb 100644
|
2018-01-15 06:36:24 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
2018-07-19 02:55:52 +08:00
|
|
|
@@ -47,6 +47,15 @@ public final class SpawnerCreature {
|
2018-01-15 06:36:24 +08:00
|
|
|
byte b0 = worldserver.spigotConfig.mobSpawnRange;
|
|
|
|
b0 = ( b0 > worldserver.spigotConfig.viewDistance ) ? (byte) worldserver.spigotConfig.viewDistance : b0;
|
|
|
|
b0 = ( b0 > 8 ) ? 8 : b0;
|
|
|
|
+ // Paper start
|
|
|
|
+ com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent event;
|
|
|
|
+ event = new com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent(
|
|
|
|
+ (org.bukkit.entity.Player) entityhuman.getBukkitEntity(), b0);
|
|
|
|
+ if (!event.callEvent()) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ b0 = event.getSpawnRadius();
|
|
|
|
+ // Paperr end
|
|
|
|
|
|
|
|
for (int i1 = -b0; i1 <= b0; ++i1) {
|
|
|
|
for (k = -b0; k <= b0; ++k) {
|
|
|
|
--
|
2018-06-30 13:40:52 +08:00
|
|
|
2.18.0
|
2018-01-15 06:36:24 +08:00
|
|
|
|