Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.12.2] 世界中存在盖亚守护者III时,重启服务器崩溃 #138

Open
zer0M1nd opened this issue Feb 4, 2022 · 0 comments
Open

Comments

@zer0M1nd
Copy link

zer0M1nd commented Feb 4, 2022

问题:服务器内存在盖亚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
已自测可解决问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant