amazing...

This commit is contained in:
ayunami2000 2022-04-21 15:58:48 -04:00
parent e37f74136e
commit e219717db6
4 changed files with 8 additions and 5 deletions

View File

@ -34,7 +34,6 @@ public class Main extends JavaPlugin implements CommandExecutor, Listener {
@Override
public void onEnable(){
MessageHandler.initMessages();
this.saveDefaultConfig();
this.rlConfig();
syncTask = this.getServer().getScheduler().scheduleSyncRepeatingTask(this, this::syncToAllPlayers, 10000, 10000); // sync every 10 seconds
@ -49,6 +48,7 @@ public class Main extends JavaPlugin implements CommandExecutor, Listener {
}
private void rlConfig() {
MessageHandler.initMessages();
audioLoc.setX(this.getConfig().getDouble("audio.x"));
audioLoc.setY(this.getConfig().getDouble("audio.y"));
audioLoc.setZ(this.getConfig().getDouble("audio.z"));
@ -89,7 +89,9 @@ public class Main extends JavaPlugin implements CommandExecutor, Listener {
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
syncToPlayer(event.getPlayer());
Player player = event.getPlayer();
videoMapCodec.beginPlaybackBukkit(videoMapCodec.getURL(), videoMapCodec.isLoopEnable(), videoMapCodec.getDuration()).send(player);
syncToPlayer(player);
}
@Override
@ -164,6 +166,7 @@ public class Main extends JavaPlugin implements CommandExecutor, Listener {
case "p":
case "play":
case "pause":
if (args.length > 1 && args[1].equalsIgnoreCase("force")) urlChanged = true;
if (urlChanged || videoMapCodec.isPaused()) {
if (urlChanged) {
urlChanged = false;

View File

@ -34,8 +34,8 @@ public class VideoMapPacketCodec {
this.posX = posX;
this.posY = posY;
this.posZ = posZ;
this.volume = 1.0f;
this.frameRate = 60;
this.volume = volume;
this.frameRate = 30;
this.requiresPositionPacket = true;
this.requiresFullResetPacket = true;
this.isDisabled = true;

View File

@ -4,7 +4,7 @@ usage:
- "&7&o/ayunvid [h|help] &3- Show this message."
- "&7&o/ayunvid <u|url> [url] &3- Specify the video URL to use, or get the current one. &l(Must be CORS-compatible!)"
- "&7&o/ayunvid <l|loc|location> [x y z] &3- Specify the location that the audio will come from. If no arguments are supplied, this will default to the sender's position."
- "&7&o/ayunvid <p|play|pause> &3- Toggle playback of the video. This also loads the new video after the video URL is changed."
- "&7&o/ayunvid <p|play|pause> [force] &3- Toggle playback of the video. This also loads the new video after the video URL is changed. Optionally force a reload of the video."
- "&7&o/ayunvid <s|size> [<width> <height>] &3- Sets or gets the size of video, in maps. E.g., a width of 2 and a height of 3 would result in a video using 6 maps."
- "&7&o/ayunvid <rl|reload> &3- Reloads the configuration file."
currentUrl: "&3Current URL: {0}"