[FIXED] Multiple SpawnOptions not working due to improper number casting.

[CHANGED] Using NMS implementations to set MOB AI instead of Core EntityUtils
This commit is contained in:
singh 2024-08-20 22:01:42 +05:30
parent da7ee8976f
commit 5efa573c04
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,9 @@
package com.craftaro.epicspawners.spawners.spawner.option;
import com.craftaro.core.math.MathUtils;
import com.craftaro.core.nms.Nms;
import com.craftaro.core.nms.entity.NmsEntity;
import com.craftaro.core.nms.v1_8_R1.entity.NmsEntityImpl;
import com.craftaro.core.utils.EntityUtils;
import com.craftaro.epicspawners.EpicSpawners;
import com.craftaro.epicspawners.api.boosts.types.Boosted;
@ -63,7 +66,8 @@ public class SpawnOptionEntity implements SpawnOption {
equation = equation.replace("{RAND}", Integer.toString(randomAmt));
equation = equation.replace("{STACK_SIZE}", Integer.toString(stack.getStackSize()));
spawnCount += MathUtils.eval(equation, "EpicSpawners (Mobs Spawned Per Single Spawn) Equation");
spawnCount += (int) MathUtils.eval(equation, "EpicSpawners (Mobs Spawned Per Single Spawn) Equation");
System.out.println(spawnCount);
}
// Get the max entities allowed around a spawner.
@ -108,7 +112,7 @@ public class SpawnOptionEntity implements SpawnOption {
}
if (Settings.NO_AI.getBoolean()) {
EntityUtils.setUnaware(entity);
Nms.getImplementations().getEntity().setMobAware(entity,false);
}
this.plugin.getSpawnManager().addUnnaturalSpawn(entity.getUniqueId());

View File

@ -19,7 +19,7 @@
<url>https://craftaro.com/marketplace/product/13</url>
<properties>
<craftaro.coreVersion>3.1.0-SNAPSHOT</craftaro.coreVersion>
<craftaro.coreVersion>3.3.0-SNAPSHOT</craftaro.coreVersion>
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.target>1.8</maven.compiler.target>