mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-07-03 00:05:45 +00:00
rtponfirstjoin ignores delays/cooldowns
This commit is contained in:
parent
12125d258f
commit
4c2dbae45a
@ -42,7 +42,10 @@ public class Join {
|
||||
//RTP on first join
|
||||
private static void rtpOnFirstJoin(Player p) {
|
||||
if (getPl().getSettings().isRtpOnFirstJoin_Enabled() && !p.hasPlayedBefore())
|
||||
HelperRTP.tp(p, Bukkit.getConsoleSender(), Bukkit.getWorld(getPl().getSettings().getRtpOnFirstJoin_World()), null, RTP_TYPE.JOIN); //Console is sender to override delays
|
||||
HelperRTP.tp(p, Bukkit.getConsoleSender(),
|
||||
Bukkit.getWorld(getPl().getSettings().getRtpOnFirstJoin_World()),
|
||||
null, RTP_TYPE.JOIN, true, true);
|
||||
//Fixed via @kazigk on Github
|
||||
}
|
||||
|
||||
private static BetterRTP getPl() {
|
||||
|
@ -3,6 +3,7 @@ package me.SuperRonanCraft.BetterRTP.references.depends.regionPlugins;
|
||||
import lombok.Getter;
|
||||
import me.SuperRonanCraft.BetterRTP.references.settings.SoftDepends;
|
||||
|
||||
@Getter
|
||||
public enum REGIONPLUGINS {
|
||||
FACTIONSUUID("FactionsUUID", "Factions", new RTP_FactionsUUID()),
|
||||
GRIEFDEFENDER("GriefDefender", new RTP_GriefDefender()),
|
||||
@ -22,9 +23,9 @@ public enum REGIONPLUGINS {
|
||||
FACTIONSBRIDGE("FactionsBridge", new RTP_FactionsBridge()),
|
||||
CRASH_CLAIM("CrashClaim", new RTP_CrashClaim());
|
||||
|
||||
@Getter private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
|
||||
@Getter private final String setting_name, pluginyml_name;
|
||||
@Getter private final RegionPluginCheck validator;
|
||||
private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
|
||||
private final String setting_name, pluginyml_name;
|
||||
private final RegionPluginCheck validator;
|
||||
|
||||
REGIONPLUGINS(String all_name, RegionPluginCheck validator) {
|
||||
this(all_name, all_name, validator);
|
||||
|
@ -2,26 +2,18 @@ package me.SuperRonanCraft.BetterRTP.references.depends.regionPlugins;
|
||||
|
||||
import net.william278.husktowns.api.BukkitHuskTownsAPI;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class RTP_HuskTowns implements RegionPluginCheck {
|
||||
|
||||
private final BukkitHuskTownsAPI huskTownsAPI;
|
||||
|
||||
public RTP_HuskTowns(JavaPlugin plugin) {
|
||||
this.huskTownsAPI = BukkitHuskTownsAPI.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean check(Location loc) {
|
||||
boolean result = true;
|
||||
if (REGIONPLUGINS.HUSKTOWNS.isEnabled()) {
|
||||
try {
|
||||
result = !huskTownsAPI.getClaimAt(loc).isPresent();
|
||||
result = !BukkitHuskTownsAPI.getInstance().getClaimAt(loc).isPresent();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user