so basically, i want to put conditionalsleep in a method, so that i dont have to paste all those lines of codes everytime
this is what i got. i know it doesn't work, but i was wondering if someone could explain why it doesn't work.
This works
new ConditionalSleep(7000)
{
@Override
public boolean condition() throws InterruptedException
{
return ctx.getInventory().getAmount("Plank") > amountOfPlankInInventory;
}
}.sleep();
This doesn't
public void condSleep(int timeout,boolean statement)
{
new ConditionalSleep(timeout)
{
@Override
public boolean condition() throws InterruptedException
{
return statement;
}
}.sleep();
}
condSleep(7000,ctx.getInventory().getAmount("Plank") > amountOfPlankInInventory);