Describe the bug
Division by zero if falling-check-ticks option set to 1.
[04:08:19 ERROR]: Couldn't pass ProxyInitializeEvent to limbofilter 1.1.19
java.lang.ArithmeticException: / by zero
at net.elytrium.limbofilter.cache.CachedPackets.createExpPackets(CachedPackets.java:326) ~[?:?]
at net.elytrium.limbofilter.cache.CachedPackets.createPackets(CachedPackets.java:105) ~[?:?]
at net.elytrium.limbofilter.LimboFilter.reload(LimboFilter.java:329) ~[?:?]
at net.elytrium.limbofilter.LimboFilter.onProxyInitialization(LimboFilter.java:139) ~[?:?]
at net.elytrium.limbofilter.Lmbda$7.execute(Unknown Source) ~[?:?]
at com.velocitypowered.proxy.event.UntargetedEventHandler$VoidHandler.lambda$buildHandler$0(UntargetedEventHandler.java:56) ~[velocity.jar:3.5.0-SNAPSHOT (git-ad8de436-b594)]
at com.velocitypowered.proxy.event.VelocityEventManager.fire(VelocityEventManager.java:677) ~[velocity.jar:3.5.0-SNAPSHOT (git-ad8de436-b594)]
at com.velocitypowered.proxy.event.VelocityEventManager.lambda$fire$5(VelocityEventManager.java:542) ~[velocity.jar:3.5.0-SNAPSHOT (git-ad8de436-b594)]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
private PreparedPacket[] createExpPackets(LimboFactory limboFactory, PacketFactory packetFactory) {
int ticks = Settings.IMP.MAIN.FALLING_CHECK_TICKS;
PreparedPacket[] packets = new PreparedPacket[ticks];
final int ticksM1 = ticks - 1;
for (int i = 0; i < ticks; ++i) {
packets[i] = limboFactory.createPreparedPacket().prepare(packetFactory.createSetExperiencePacket((float) i / ticksM1, (i * 100) / ticksM1, 0)).build();
}
return packets;
}
To Reproduce
Steps to reproduce the behavior:
- Set
falling-check-ticks in config to 1
- Start velocity
- See error
Expected behavior
Do not devide by zero, catch ArithmeticException
Server Info:
Additional context
It does not appear earlier, before I update Java, Velocity, LimboAPI, LimboAuth, LimboFilter
Describe the bug
Division by zero if
falling-check-ticksoption set to1.To Reproduce
Steps to reproduce the behavior:
falling-check-ticksin config to1Expected behavior
Do not devide by zero, catch ArithmeticException
Server Info:
Java: 21
Velocity: 3.5.0-SNAPSHOT-594
LimboAPI: a83e1b0
LimboAuth: bc8ebd9
LimboFilter: ebbc0bf
https://pastebin.com/TumYJerJ
Additional context
It does not appear earlier, before I update Java, Velocity, LimboAPI, LimboAuth, LimboFilter