mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
71c18fd5c9
This simply provides the base API to create the objects. Further commits will come that adds adds usage of this API to existing GameProfile based API's, as well as new API's.
34 lines
1.6 KiB
Diff
34 lines
1.6 KiB
Diff
From ece277fc5badcf214e311535c3405c5bd937f754 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index f64de94fa..2af22d15d 100644
|
|
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
|
|
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
|
@@ -72,6 +72,15 @@ public final class SpawnerCreature {
|
|
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) {
|
|
--
|
|
2.15.1
|
|
|