Fix RTP on death on custom worlds and add it to debug print (#247)

This commit is contained in:
Jan Maleta 2025-08-07 16:39:25 +02:00 committed by GitHub
parent 3cf85f2ce6
commit 1f16f943e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View File

@ -45,6 +45,12 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
BetterRTP.debug("- UseWorldBorder: " + this.useWorldborder); BetterRTP.debug("- UseWorldBorder: " + this.useWorldborder);
} }
} }
if (test.get("RTPOnDeath") != null) {
if (test.get("RTPOnDeath").getClass() == Boolean.class) {
RTPOnDeath = Boolean.parseBoolean(test.get("RTPOnDeath").toString());
BetterRTP.debug("- RTPOnDeath: " + this.RTPOnDeath);
}
}
if (test.get("CenterX") != null) { if (test.get("CenterX") != null) {
if (test.get("CenterX").getClass() == Integer.class) { if (test.get("CenterX").getClass() == Integer.class) {
centerX = Integer.parseInt((test.get("CenterX")).toString()); centerX = Integer.parseInt((test.get("CenterX")).toString());
@ -203,7 +209,8 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
return cooldown; return cooldown;
} }
@Override public boolean getRTPOnDeath() { @Override
public boolean getRTPOnDeath() {
return RTPOnDeath; return RTPOnDeath;
} }
@ -268,7 +275,8 @@ public class WorldCustom implements RTPWorld, RTPWorld_Defaulted {
this.cooldown = value; this.cooldown = value;
} }
@Override public void setRTPOnDeath(boolean bool) { @Override
RTPOnDeath = bool; public void setRTPOnDeath(boolean value) {
this.RTPOnDeath = value;
} }
} }

View File

@ -76,6 +76,7 @@ public class WorldDefault implements RTPWorld {
if (BetterRTP.getInstance().getSettings().isDebug()) { if (BetterRTP.getInstance().getSettings().isDebug()) {
Logger log = BetterRTP.getInstance().getLogger(); Logger log = BetterRTP.getInstance().getLogger();
log.info("- UseWorldBorder: " + this.useWorldborder); log.info("- UseWorldBorder: " + this.useWorldborder);
log.info("- RTPOnDeath: " + this.RTPOnDeath);
log.info("- CenterX: " + this.centerX); log.info("- CenterX: " + this.centerX);
log.info("- CenterZ: " + this.centerZ); log.info("- CenterZ: " + this.centerZ);
log.info("- MaxRadius: " + this.maxRad); log.info("- MaxRadius: " + this.maxRad);
@ -151,7 +152,8 @@ public class WorldDefault implements RTPWorld {
return BetterRTP.getInstance().getCooldowns().getDefaultCooldownTime(); return BetterRTP.getInstance().getCooldowns().getDefaultCooldownTime();
} }
@Override public boolean getRTPOnDeath() { @Override
public boolean getRTPOnDeath() {
return RTPOnDeath; return RTPOnDeath;
} }
} }