diff --git a/src/main/java/me/ayunami2000/ayunEagVidMap/Main.java b/src/main/java/me/ayunami2000/ayunEagVidMap/Main.java index 7337544..58442dc 100644 --- a/src/main/java/me/ayunami2000/ayunEagVidMap/Main.java +++ b/src/main/java/me/ayunami2000/ayunEagVidMap/Main.java @@ -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; diff --git a/src/main/java/me/ayunami2000/ayunEagVidMap/VideoMapPacketCodec.java b/src/main/java/me/ayunami2000/ayunEagVidMap/VideoMapPacketCodec.java index 6a20ee2..11798ba 100644 --- a/src/main/java/me/ayunami2000/ayunEagVidMap/VideoMapPacketCodec.java +++ b/src/main/java/me/ayunami2000/ayunEagVidMap/VideoMapPacketCodec.java @@ -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; diff --git a/src/main/resources/messages.yml b/src/main/resources/messages.yml index a689af2..489940d 100644 --- a/src/main/resources/messages.yml +++ b/src/main/resources/messages.yml @@ -4,7 +4,7 @@ usage: - "&7&o/ayunvid [h|help] &3- Show this message." - "&7&o/ayunvid [url] &3- Specify the video URL to use, or get the current one. &l(Must be CORS-compatible!)" - "&7&o/ayunvid [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 &3- Toggle playback of the video. This also loads the new video after the video URL is changed." + - "&7&o/ayunvid [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 [ ] &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 &3- Reloads the configuration file." currentUrl: "&3Current URL: {0}" diff --git a/target/ayunEagVidMap-1.0-SNAPSHOT.jar b/target/ayunEagVidMap-1.0-SNAPSHOT.jar index 89c2d20..1632821 100644 Binary files a/target/ayunEagVidMap-1.0-SNAPSHOT.jar and b/target/ayunEagVidMap-1.0-SNAPSHOT.jar differ