MoonSouhayl
MoonSouhayl
Explore posts from servers
JCHJava Community | Help. Code. Learn.
Created by NieR Enthusiast on 10/23/2024 in #java-help
Declaring isEmpty() and searchString() methods?
oh god, comments between the method name and the code block
9 replies
JCHJava Community | Help. Code. Learn.
Created by MoonSouhayl on 5/9/2024 in #java-help
timer already canceled
gonna take a look at ScheduledExecutorService
23 replies
JCHJava Community | Help. Code. Learn.
Created by MoonSouhayl on 5/9/2024 in #java-help
timer already canceled
im using Timer cause i wrote Time and intelliJ gave it to me
23 replies
JCHJava Community | Help. Code. Learn.
Created by MoonSouhayl on 5/9/2024 in #java-help
timer already canceled
i meaaaaaan
23 replies
JCHJava Community | Help. Code. Learn.
Created by MoonSouhayl on 5/9/2024 in #java-help
timer already canceled
yep...
23 replies
JCHJava Community | Help. Code. Learn.
Created by MoonSouhayl on 5/9/2024 in #java-help
timer already canceled
if thats what ur asking about
23 replies
JCHJava Community | Help. Code. Learn.
Created by MoonSouhayl on 5/9/2024 in #java-help
timer already canceled
it was smth like this
public void setCaught() {
timer.cancel();
huntCaught = true;
}
public void setCaught() {
timer.cancel();
huntCaught = true;
}
23 replies
JCHJava Community | Help. Code. Learn.
Created by MoonSouhayl on 5/9/2024 in #java-help
timer already canceled
timer.schedule(new TimerTask() {
@Override
public void run() {
if(huntEnded) return;

if(!PokeHunt.config.isCoolDownEnabled()) {
startNewHunt();
} else {

if (PokeHunt.config.isIndividualHunts() && PokeHunt.config.isSendHuntEndMessage()) {

Objects.requireNonNull(PokeHunt.server.getPlayerList().getPlayer(owner)).sendSystemMessage(
Component.literal(
Utils.formatPlaceholders(PokeHunt.language.getEndedHuntMessage(), null, pokemon)));

} else if (PokeHunt.config.isSendHuntEndMessage()) {

Utils.broadcastMessage(
Utils.formatPlaceholders(PokeHunt.language.getEndedHuntMessage(), null, pokemon));

}

huntEnded = true;
addToEndTime(PokeHunt.config.getCoolDown(strRarity)*60*1000);
timer.schedule(new TimerTask() {
@Override
public void run() {
startNewHunt();
}
}, PokeHunt.config.getCoolDown(strRarity)*60*1000);
}
}
}, duration);



timer.schedule(new TimerTask() {
@Override
public void run() {
if(huntEnded) return;

startNewHunt();
if(!isOwnerOnline()) {
huntEnd(Cause.OWNER_OFFLINE);
}
}
}, duration + PokeHunt.config.getCoolDown(strRarity)*60*1000 + PokeHunt.config.getSafetyDelay);
timer.schedule(new TimerTask() {
@Override
public void run() {
if(huntEnded) return;

if(!PokeHunt.config.isCoolDownEnabled()) {
startNewHunt();
} else {

if (PokeHunt.config.isIndividualHunts() && PokeHunt.config.isSendHuntEndMessage()) {

Objects.requireNonNull(PokeHunt.server.getPlayerList().getPlayer(owner)).sendSystemMessage(
Component.literal(
Utils.formatPlaceholders(PokeHunt.language.getEndedHuntMessage(), null, pokemon)));

} else if (PokeHunt.config.isSendHuntEndMessage()) {

Utils.broadcastMessage(
Utils.formatPlaceholders(PokeHunt.language.getEndedHuntMessage(), null, pokemon));

}

huntEnded = true;
addToEndTime(PokeHunt.config.getCoolDown(strRarity)*60*1000);
timer.schedule(new TimerTask() {
@Override
public void run() {
startNewHunt();
}
}, PokeHunt.config.getCoolDown(strRarity)*60*1000);
}
}
}, duration);



timer.schedule(new TimerTask() {
@Override
public void run() {
if(huntEnded) return;

startNewHunt();
if(!isOwnerOnline()) {
huntEnd(Cause.OWNER_OFFLINE);
}
}
}, duration + PokeHunt.config.getCoolDown(strRarity)*60*1000 + PokeHunt.config.getSafetyDelay);
23 replies
JCHJava Community | Help. Code. Learn.
Created by netty on 4/24/2024 in #java-help
Calculate amount of time between 2 dates
double the chances to get help :b
8 replies