[1.12.2] 世界中存在盖亚守护者III时,重启服务器崩溃
zer0M1nd opened this issue · 0 comments
问题:服务器内存在盖亚III,重启服务器,服务器完全启动后(非启动中)立即崩溃
Crash report:
Time: 2/4/22 8:37 PM
Description: Ticking entity
java.lang.IllegalArgumentException: bound must be positive
at java.util.Random.nextInt(Random.java:388)
at com.meteor.extrabotany.common.entity.gaia.EntityGaiaIII.func_70636_d(EntityGaiaIII.java:284)
at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2179)
at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:295)
at net.minecraft.world.World.func_72866_a(World.java:1996)
at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:832)
at net.minecraft.world.World.func_72870_g(World.java:1958)
at net.minecraft.world.World.func_72939_s(World.java:1762)
at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:397)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)
at java.lang.Thread.run(Thread.java:748)
出现问题的代码:
src/main/java/com/meteor/extrabotany/common/entity/gaia/EntityGaiaIII.java
int y = (int) players.get(rand.nextInt(players.size())).posY;
解决方法:在前面的if里加入 players.size() > 0
已自测可解决问题