Closed commandblock2 closed 4 years ago
In my case it seemed that interval()/timeout() was broken. Using these function will cause TypeError: Can not create new object with constructor net.minecraft.util.Timer with the passed arguments; they do not match any of its method signatures.
TypeError: Can not create new object with constructor net.minecraft.util.Timer with the passed arguments; they do not match any of its method signatures.
It seemed that Timer was imported as net.minecraft.util.Timer(Auto Import) instead of java.util.Timer. https://github.com/CzechHek/Core/blob/f8653d96358b9bcadbff5513d547a79a19a38e73/Core.lib#L218 https://github.com/CzechHek/Core/blob/f8653d96358b9bcadbff5513d547a79a19a38e73/Core.lib#L222
Timer
net.minecraft.util.Timer
java.util.Timer
interval was defined using Timer. function interval(ms, func) (_timer = new Timer("setInterval", true), _timer.schedule(func, 0, ms), _timer);.
interval
function interval(ms, func) (_timer = new Timer("setInterval", true), _timer.schedule(func, 0, ms), _timer);
Renaming Timer to JavaTimer should fix the problem. (Can't come up with a better name lol).
JavaTimer
In my case it seemed that interval()/timeout() was broken. Using these function will cause
TypeError: Can not create new object with constructor net.minecraft.util.Timer with the passed arguments; they do not match any of its method signatures.
It seemed that
Timer
was imported asnet.minecraft.util.Timer
(Auto Import) instead ofjava.util.Timer
. https://github.com/CzechHek/Core/blob/f8653d96358b9bcadbff5513d547a79a19a38e73/Core.lib#L218 https://github.com/CzechHek/Core/blob/f8653d96358b9bcadbff5513d547a79a19a38e73/Core.lib#L222interval
was defined usingTimer
.function interval(ms, func) (_timer = new Timer("setInterval", true), _timer.schedule(func, 0, ms), _timer);
.Renaming
Timer
toJavaTimer
should fix the problem. (Can't come up with a better name lol).