The plugin is now affecting natural spawning only
This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'net.ardakaz'
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -30,11 +30,18 @@ public class SimpleMobSpawningOptimizer extends JavaPlugin implements Listener {
|
||||
@EventHandler
|
||||
public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
|
||||
// Return if the spawn was not natural
|
||||
if (event.getSpawnReason() != CreatureSpawnEvent.SpawnReason.NATURAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Defining variables
|
||||
int currentSimulationDistance = getSimulationDistance();
|
||||
int normalSimulationDistance = 10;
|
||||
double mobPercentage = Math.pow(currentSimulationDistance, 2) / Math.pow(normalSimulationDistance, 2);
|
||||
|
||||
if (random.nextDouble() > mobPercentage) {
|
||||
// Cancelling event
|
||||
event.setCancelled(true);
|
||||
mobsNotSpawned += 1;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: SimpleMobSpawningOptimizer
|
||||
version: '1.0'
|
||||
version: '1.1'
|
||||
main: net.ardakaz.simpleMobSpawningOptimizer.SimpleMobSpawningOptimizer
|
||||
api-version: '1.21'
|
||||
|
||||
Reference in New Issue
Block a user