diff --git a/scripts/commands/generic/cmdBroadcast.js b/scripts/commands/generic/cmdBroadcast.js index 19b48fb33..16378cd02 100644 --- a/scripts/commands/generic/cmdBroadcast.js +++ b/scripts/commands/generic/cmdBroadcast.js @@ -1,5 +1,3 @@ function executeCommand(galacticManager, player, target, args) { - var ChatBroadcastIntent = Java.type("intents.chat.ChatBroadcastIntent"); - var BroadcastType = Java.type("intents.chat.ChatBroadcastIntent.BroadcastType"); - new ChatBroadcastIntent(args, player, player.getCreatureObject().getLocation().getTerrain(), BroadcastType.PLANET).broadcast(); + intentFactory.broadcastPlanet(player.getCreatureObject().getLocation().getTerrain(), args); } \ No newline at end of file diff --git a/scripts/commands/generic/cmdBroadcastArea.js b/scripts/commands/generic/cmdBroadcastArea.js index 627c7663b..c2fa67f92 100644 --- a/scripts/commands/generic/cmdBroadcastArea.js +++ b/scripts/commands/generic/cmdBroadcastArea.js @@ -1,5 +1,3 @@ function executeCommand(galacticManager, player, target, args) { - var ChatBroadcastIntent = Java.type("intents.chat.ChatBroadcastIntent"); - var BroadcastType = Java.type("intents.chat.ChatBroadcastIntent.BroadcastType"); - new ChatBroadcastIntent(args, player, player.getCreatureObject().getLocation().getTerrain(), BroadcastType.AREA).broadcast(); + intentFactory.broadcastArea(args, player); } \ No newline at end of file diff --git a/scripts/commands/generic/cmdBroadcastGalaxy.js b/scripts/commands/generic/cmdBroadcastGalaxy.js index e2b78cbd5..87f68d666 100644 --- a/scripts/commands/generic/cmdBroadcastGalaxy.js +++ b/scripts/commands/generic/cmdBroadcastGalaxy.js @@ -1,5 +1,3 @@ function executeCommand(galacticManager, player, target, args) { - var ChatBroadcastIntent = Java.type("intents.chat.ChatBroadcastIntent"); - var BroadcastType = Java.type("intents.chat.ChatBroadcastIntent.BroadcastType"); - new ChatBroadcastIntent(args, player, player.getCreatureObject().getLocation().getTerrain(), BroadcastType.GALAXY).broadcast(); + intentFactory.broadcastGalaxy(args, player); } \ No newline at end of file diff --git a/scripts/commands/generic/cmdBroadcastPlanet.js b/scripts/commands/generic/cmdBroadcastPlanet.js index 19b48fb33..16378cd02 100644 --- a/scripts/commands/generic/cmdBroadcastPlanet.js +++ b/scripts/commands/generic/cmdBroadcastPlanet.js @@ -1,5 +1,3 @@ function executeCommand(galacticManager, player, target, args) { - var ChatBroadcastIntent = Java.type("intents.chat.ChatBroadcastIntent"); - var BroadcastType = Java.type("intents.chat.ChatBroadcastIntent.BroadcastType"); - new ChatBroadcastIntent(args, player, player.getCreatureObject().getLocation().getTerrain(), BroadcastType.PLANET).broadcast(); + intentFactory.broadcastPlanet(player.getCreatureObject().getLocation().getTerrain(), args); } \ No newline at end of file diff --git a/src/utilities/IntentFactory.java b/src/utilities/IntentFactory.java index e90d4df35..07fca1c1b 100644 --- a/src/utilities/IntentFactory.java +++ b/src/utilities/IntentFactory.java @@ -37,9 +37,10 @@ public final class IntentFactory { /** * Sends a system message to the entire galaxy. * @param message System message to broadcast. + * @param source The source of this system message. */ - public void broadcastGalaxy(String message) { - broadcast(message, null, BroadcastType.GALAXY); + public void broadcastGalaxy(String message, Player source) { + broadcast(message, source, BroadcastType.GALAXY); } /**