-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from ZorgBtw/dev
🔥 Prepare for 1.1.0
- Loading branch information
Showing
71 changed files
with
3,023 additions
and
979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/fr/zorg/bungeesk/bukkit/skript/effects/EffBroadcastMessageToNetwork.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package fr.zorg.bungeesk.bukkit.skript.effects; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Examples; | ||
import ch.njol.skript.doc.Name; | ||
import ch.njol.skript.doc.Since; | ||
import ch.njol.skript.lang.Effect; | ||
import ch.njol.skript.lang.Expression; | ||
import ch.njol.skript.lang.SkriptParser; | ||
import ch.njol.util.Kleenean; | ||
import fr.zorg.bungeesk.bukkit.BungeeSK; | ||
import fr.zorg.bungeesk.bukkit.sockets.ConnectionClient; | ||
import org.bukkit.event.Event; | ||
|
||
@Name("Broadcast message to the network") | ||
@Description("Broadcast message to the network, like the /alert command does but with more personalization (the messages will not appear in the spigot consoles)") | ||
@Examples("broadcast \"&6Hello everyone\" to network") | ||
@Since("1.1.0") | ||
public class EffBroadcastMessageToNetwork extends Effect { | ||
|
||
static { | ||
Skript.registerEffect(EffBroadcastMessageToNetwork.class, | ||
"broadcast %string% to [the] network"); | ||
} | ||
|
||
private Expression<String> message; | ||
|
||
@Override | ||
public boolean init(Expression<?>[] exprs, int pattern, Kleenean kleenean, SkriptParser.ParseResult parseResult) { | ||
this.message = (Expression<String>) exprs[0]; | ||
return true; | ||
} | ||
|
||
@Override | ||
protected void execute(Event e) { | ||
if (BungeeSK.isClientConnected()) { | ||
ConnectionClient.get().write(true, "effectBroadcastMessageToNetwork", | ||
"message", this.message.getSingle(e)); | ||
} | ||
} | ||
|
||
@Override | ||
public String toString(Event e, boolean debug) { | ||
return "broadcast message " + this.message.toString(e, debug) + " into the whole bungeecord network"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.