mirror of
https://github.com/RonanPlugins/BetterRTP.git
synced 2025-07-03 08:15:42 +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
|
//RTP on first join
|
||||||
private static void rtpOnFirstJoin(Player p) {
|
private static void rtpOnFirstJoin(Player p) {
|
||||||
if (getPl().getSettings().isRtpOnFirstJoin_Enabled() && !p.hasPlayedBefore())
|
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() {
|
private static BetterRTP getPl() {
|
||||||
|
@ -3,6 +3,7 @@ package me.SuperRonanCraft.BetterRTP.references.depends.regionPlugins;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import me.SuperRonanCraft.BetterRTP.references.settings.SoftDepends;
|
import me.SuperRonanCraft.BetterRTP.references.settings.SoftDepends;
|
||||||
|
|
||||||
|
@Getter
|
||||||
public enum REGIONPLUGINS {
|
public enum REGIONPLUGINS {
|
||||||
FACTIONSUUID("FactionsUUID", "Factions", new RTP_FactionsUUID()),
|
FACTIONSUUID("FactionsUUID", "Factions", new RTP_FactionsUUID()),
|
||||||
GRIEFDEFENDER("GriefDefender", new RTP_GriefDefender()),
|
GRIEFDEFENDER("GriefDefender", new RTP_GriefDefender()),
|
||||||
@ -22,9 +23,9 @@ public enum REGIONPLUGINS {
|
|||||||
FACTIONSBRIDGE("FactionsBridge", new RTP_FactionsBridge()),
|
FACTIONSBRIDGE("FactionsBridge", new RTP_FactionsBridge()),
|
||||||
CRASH_CLAIM("CrashClaim", new RTP_CrashClaim());
|
CRASH_CLAIM("CrashClaim", new RTP_CrashClaim());
|
||||||
|
|
||||||
@Getter private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
|
private final SoftDepends.RegionPlugin plugin = new SoftDepends.RegionPlugin();
|
||||||
@Getter private final String setting_name, pluginyml_name;
|
private final String setting_name, pluginyml_name;
|
||||||
@Getter private final RegionPluginCheck validator;
|
private final RegionPluginCheck validator;
|
||||||
|
|
||||||
REGIONPLUGINS(String all_name, RegionPluginCheck validator) {
|
REGIONPLUGINS(String all_name, RegionPluginCheck validator) {
|
||||||
this(all_name, all_name, 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 net.william278.husktowns.api.BukkitHuskTownsAPI;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
public class RTP_HuskTowns implements RegionPluginCheck {
|
public class RTP_HuskTowns implements RegionPluginCheck {
|
||||||
|
|
||||||
private final BukkitHuskTownsAPI huskTownsAPI;
|
|
||||||
|
|
||||||
public RTP_HuskTowns(JavaPlugin plugin) {
|
|
||||||
this.huskTownsAPI = BukkitHuskTownsAPI.getInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean check(Location loc) {
|
public boolean check(Location loc) {
|
||||||
boolean result = true;
|
boolean result = true;
|
||||||
if (REGIONPLUGINS.HUSKTOWNS.isEnabled()) {
|
if (REGIONPLUGINS.HUSKTOWNS.isEnabled()) {
|
||||||
try {
|
try {
|
||||||
result = !huskTownsAPI.getClaimAt(loc).isPresent();
|
result = !BukkitHuskTownsAPI.getInstance().getClaimAt(loc).isPresent();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user