This might break everything so test this first on alpha or something
This should check if a player is in vanish
This commit is contained in:
parent
295b9d1ee2
commit
c259e3f035
|
|
@ -45,4 +45,5 @@ tasks {
|
|||
|
||||
dependencies {
|
||||
compileOnly("com.alttd:Galaxy-API:1.18.1-R0.1-SNAPSHOT")
|
||||
compileOnly("com.github.LeonMangler:PremiumVanishAPI:2.7.11-2")
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ dependencyResolutionManagement {
|
|||
mavenLocal()
|
||||
mavenCentral()
|
||||
maven("https://papermc.io/repo/repository/maven-public/") // Paper
|
||||
maven("https://jitpack.io") //PremiumVanish
|
||||
}
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import com.alttd.frameSpawners.FrameSpawnerLocation;
|
|||
import com.alttd.frameSpawners.FrameSpawnerPlayer;
|
||||
import com.alttd.storage.PlayerSettings;
|
||||
import com.alttd.util.Logger;
|
||||
import de.myzelyam.api.vanish.VanishAPI;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
|
@ -34,15 +36,15 @@ public class ParticleSet {
|
|||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
public void run(Location location, UUID uuid) {
|
||||
if (tooSoon(uuid))
|
||||
public void run(Location location, Player player) {
|
||||
if (tooSoon(player.getUniqueId()) || isVanished(player))
|
||||
return;
|
||||
FrameSpawnerLocation frameSpawnerLocation = new FrameSpawnerLocation(repeat, repeatDelay, frames, location);
|
||||
frameSpawnerLocation.runTaskTimerAsynchronously(AltitudeParticles.getInstance(), 0, frameDelay);
|
||||
}
|
||||
|
||||
public void run(Player player, PlayerSettings playerSettings, UUID uuid) {
|
||||
if (tooSoon(uuid) && !player.hasPermission("apart.bypass-cooldown"))
|
||||
public void run(Player player, PlayerSettings playerSettings) {
|
||||
if (tooSoon(player.getUniqueId()) && !player.hasPermission("apart.bypass-cooldown"))
|
||||
return;
|
||||
if (Config.DEBUG)
|
||||
Logger.info("Starting particle set % for %.", uniqueId, player.getName());
|
||||
|
|
@ -50,6 +52,10 @@ public class ParticleSet {
|
|||
frameSpawnerPlayer.runTaskTimerAsynchronously(AltitudeParticles.getInstance(), 0, frameDelay);
|
||||
}
|
||||
|
||||
private boolean isVanished(Player player) {
|
||||
return VanishAPI.isInvisible(player) || player.getGameMode().equals(GameMode.SPECTATOR);
|
||||
}
|
||||
|
||||
private boolean tooSoon(UUID uuid) {
|
||||
PlayerSettings ps = PlayerSettings.getPlayer(uuid);
|
||||
if (ps.canRun(aPartType))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user