fix 50%
This commit is contained in:
parent
547fe6d9bb
commit
8705cad578
118 changed files with 2714 additions and 4761 deletions
|
|
@ -1,12 +1,14 @@
|
|||
package dev.loki.loparkour.mode;
|
||||
|
||||
import dev.loki.loparkour.util.Item;
|
||||
|
||||
import dev.loki.loparkour.config.Config;
|
||||
import dev.loki.loparkour.config.Locales;
|
||||
import dev.loki.loparkour.generator.ParkourGenerator;
|
||||
import dev.loki.loparkour.leaderboard.Leaderboard;
|
||||
import dev.loki.loparkour.player.ParkourPlayer;
|
||||
import dev.loki.loparkour.session.Session;
|
||||
import dev.efnilite.vilib.inventory.item.Item;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
|
@ -26,7 +28,7 @@ public class DefaultMode implements Mode {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public Item getItem(String locale) {
|
||||
public dev.loki.loparkour.util.Item getItem(String locale) {
|
||||
return Locales.getItem(locale, "play.single.default");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
package dev.loki.loparkour.mode;
|
||||
|
||||
import dev.loki.loparkour.util.Item;
|
||||
|
||||
import dev.loki.loparkour.config.Config;
|
||||
import dev.loki.loparkour.config.Locales;
|
||||
import dev.loki.loparkour.generator.ParkourGenerator;
|
||||
import dev.loki.loparkour.leaderboard.Leaderboard;
|
||||
import dev.loki.loparkour.player.ParkourPlayer;
|
||||
import dev.loki.loparkour.session.Session;
|
||||
import dev.efnilite.vilib.inventory.item.Item;
|
||||
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
|
|
@ -29,7 +31,7 @@ public class ElytraMode implements Mode {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public Item getItem(String locale) {
|
||||
public dev.loki.loparkour.util.Item getItem(String locale) {
|
||||
return Locales.getItem(locale, "modes.elytra");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
package dev.loki.loparkour.mode;
|
||||
|
||||
import dev.loki.loparkour.util.Item;
|
||||
|
||||
import dev.loki.loparkour.config.Config;
|
||||
import dev.loki.loparkour.config.Locales;
|
||||
import dev.loki.loparkour.generator.ParkourGenerator;
|
||||
import dev.loki.loparkour.leaderboard.Leaderboard;
|
||||
import dev.loki.loparkour.player.ParkourPlayer;
|
||||
import dev.loki.loparkour.session.Session;
|
||||
import dev.efnilite.vilib.inventory.item.Item;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
|
@ -30,7 +32,7 @@ public class GravityShiftMode implements Mode {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public Item getItem(String locale) {
|
||||
public dev.loki.loparkour.util.Item getItem(String locale) {
|
||||
return Locales.getItem(locale, "play.single.gravity-shift");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
package dev.loki.loparkour.mode;
|
||||
|
||||
import dev.loki.loparkour.util.Item;
|
||||
|
||||
import dev.loki.loparkour.config.Config;
|
||||
import dev.loki.loparkour.config.Locales;
|
||||
import dev.loki.loparkour.generator.ParkourGenerator;
|
||||
import dev.loki.loparkour.leaderboard.Leaderboard;
|
||||
import dev.loki.loparkour.player.ParkourPlayer;
|
||||
import dev.loki.loparkour.session.Session;
|
||||
import dev.efnilite.vilib.inventory.item.Item;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
|
@ -23,7 +25,7 @@ public class HardcoreMode implements Mode {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public Item getItem(String locale) {
|
||||
public dev.loki.loparkour.util.Item getItem(String locale) {
|
||||
return Locales.getItem(locale, "play.single.hardcore");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package dev.loki.loparkour.mode;
|
||||
|
||||
import dev.loki.loparkour.leaderboard.Leaderboard;
|
||||
import dev.efnilite.vilib.inventory.item.Item;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
|
@ -23,7 +23,7 @@ public interface Mode {
|
|||
* @param locale The locale of the menu, used to adjust the name.
|
||||
* @return The item used in menus to show this mode. If this item is null, the mode won't be displayed.
|
||||
*/
|
||||
@Nullable Item getItem(String locale);
|
||||
@Nullable dev.loki.loparkour.util.Item getItem(String locale);
|
||||
|
||||
/**
|
||||
* @return The {@link Leaderboard} that belongs to this mode
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package dev.loki.loparkour.mode;
|
||||
|
||||
import dev.loki.loparkour.util.Item;
|
||||
|
||||
import dev.loki.loparkour.config.Config;
|
||||
import dev.loki.loparkour.config.Locales;
|
||||
import dev.loki.loparkour.leaderboard.Leaderboard;
|
||||
|
|
@ -8,8 +10,8 @@ import dev.loki.loparkour.menu.ParkourOption;
|
|||
import dev.loki.loparkour.player.ParkourSpectator;
|
||||
import dev.loki.loparkour.player.ParkourUser;
|
||||
import dev.loki.loparkour.session.Session;
|
||||
import dev.efnilite.vilib.inventory.item.Item;
|
||||
import dev.efnilite.vilib.util.Strings;
|
||||
|
||||
import dev.loki.loparkour.util.ColorUtil;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
|
@ -23,7 +25,7 @@ public class SpectatorMode implements Mode {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public Item getItem(String locale) {
|
||||
public dev.loki.loparkour.util.Item getItem(String locale) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -35,12 +37,14 @@ public class SpectatorMode implements Mode {
|
|||
|
||||
@Override
|
||||
public void create(Player player) {
|
||||
Menus.SPECTATOR.open(player);
|
||||
// TODO: Migrate to LoLib GUI
|
||||
// Menus.SPECTATOR.open(player);
|
||||
player.sendMessage("§cМеню временно недоступно во время миграции");
|
||||
}
|
||||
|
||||
public void create(Player player, Session session) {
|
||||
if (!Config.CONFIG.getBoolean("joining")) {
|
||||
player.sendMessage(Strings.colour("<red><bold>Joining is currently disabled."));
|
||||
player.sendMessage(ColorUtil.color("<red><bold>Joining is currently disabled."));
|
||||
return;
|
||||
}
|
||||
if (!ParkourOption.SPECTATOR.mayPerform(player)) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package dev.loki.loparkour.mode;
|
||||
|
||||
import dev.loki.loparkour.util.Item;
|
||||
|
||||
import dev.lolib.scheduler.Scheduler;
|
||||
|
||||
import dev.loki.loparkour.LoParkour;
|
||||
import dev.loki.loparkour.config.Config;
|
||||
import dev.loki.loparkour.config.Locales;
|
||||
|
|
@ -7,8 +11,8 @@ import dev.loki.loparkour.generator.ParkourGenerator;
|
|||
import dev.loki.loparkour.leaderboard.Leaderboard;
|
||||
import dev.loki.loparkour.player.ParkourPlayer;
|
||||
import dev.loki.loparkour.session.Session;
|
||||
import dev.efnilite.vilib.inventory.item.Item;
|
||||
import dev.efnilite.vilib.util.Task;
|
||||
|
||||
import dev.lolib.scheduler.Scheduler;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
|
|
@ -33,7 +37,7 @@ public class SpeedrunMode implements Mode {
|
|||
|
||||
@Override
|
||||
@Nullable
|
||||
public Item getItem(String locale) {
|
||||
public dev.loki.loparkour.util.Item getItem(String locale) {
|
||||
return Locales.getItem(locale, "play.single.speedrun");
|
||||
}
|
||||
|
||||
|
|
@ -74,25 +78,19 @@ public class SpeedrunMode implements Mode {
|
|||
long removalTime = (long) (blockLifetime * 1000);
|
||||
long warningTimeMs = (long) (warningTime * 1000);
|
||||
|
||||
Task.create(LoParkour.getPlugin())
|
||||
.delay((int) ((removalTime - warningTimeMs) / 50))
|
||||
.execute(() -> {
|
||||
Scheduler.get(LoParkour.getPlugin()).runLater(() -> {
|
||||
if (block.getType() != Material.AIR) {
|
||||
player.player.playSound(block.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1.0f, 2.0f);
|
||||
player.player.spawnParticle(Particle.FLAME, block.getLocation().add(0.5, 1, 0.5), 10, 0.3, 0.3, 0.3, 0.01);
|
||||
}
|
||||
})
|
||||
.run();
|
||||
}, warningTimeMs / 50);
|
||||
|
||||
Task.create(LoParkour.getPlugin())
|
||||
.delay((int) (removalTime / 50))
|
||||
.execute(() -> {
|
||||
Scheduler.get(LoParkour.getPlugin()).runLater(() -> {
|
||||
if (block.getType() != Material.AIR) {
|
||||
block.setType(Material.AIR);
|
||||
blockTimestamps.remove(block);
|
||||
}
|
||||
})
|
||||
.run();
|
||||
}, removalTime / 50);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue