-
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.
- Loading branch information
Showing
19 changed files
with
467 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Default ignored files | ||
/.idea/shelf/ | ||
/.idea/workspace.xml | ||
/.idea/*.locl | ||
/.idea/*.xml | ||
/.idea/*.iml | ||
/test/ |
This file was deleted.
Oops, something went wrong.
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
55 changes: 55 additions & 0 deletions
55
src/main/java/lol/aabss/skuishy/elements/effects/EffDisablePlugin.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,55 @@ | ||
package lol.aabss.skuishy.elements.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.ParseResult; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
@Name("Plugin - Disable Plugin") | ||
@Description("Disables a plugin") | ||
@Examples({ | ||
"disable plugin \"Essentials\"" | ||
}) | ||
@Since("1.4") | ||
|
||
public class EffDisablePlugin extends Effect { | ||
|
||
static { | ||
Skript.registerEffect(EffDisablePlugin.class, | ||
"disable plugin %string%" | ||
); | ||
} | ||
|
||
private Expression<String> plugin; | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parser) { | ||
plugin = (Expression<String>) expressions[0]; | ||
return true; | ||
} | ||
|
||
@Override | ||
public @NotNull String toString(@Nullable Event event, boolean debug) { | ||
return "disable plugin " + plugin; | ||
} | ||
|
||
@Override | ||
protected void execute(@NotNull Event event) { | ||
Plugin plugin2 = Bukkit.getPluginManager().getPlugin(plugin.getSingle(event)); | ||
if (plugin2 != null){ | ||
Bukkit.getPluginManager().disablePlugin(plugin2); | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/lol/aabss/skuishy/elements/effects/EffEnablePlugin.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,55 @@ | ||
package lol.aabss.skuishy.elements.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.ParseResult; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.plugin.Plugin; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
@Name("Plugin - Enable Plugin") | ||
@Description("Enables a plugin") | ||
@Examples({ | ||
"enable plugin \"Essentials\"" | ||
}) | ||
@Since("1.4") | ||
|
||
public class EffEnablePlugin extends Effect { | ||
|
||
static { | ||
Skript.registerEffect(EffEnablePlugin.class, | ||
"enable plugin %string%" | ||
); | ||
} | ||
|
||
private Expression<String> plugin; | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parser) { | ||
plugin = (Expression<String>) expressions[0]; | ||
return true; | ||
} | ||
|
||
@Override | ||
public @NotNull String toString(@Nullable Event event, boolean debug) { | ||
return "enable plugin " + plugin; | ||
} | ||
|
||
@Override | ||
protected void execute(@NotNull Event event) { | ||
Plugin plugin2 = Bukkit.getPluginManager().getPlugin(plugin.getSingle(event)); | ||
if (plugin2 != null){ | ||
Bukkit.getPluginManager().enablePlugin(plugin2); | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/lol/aabss/skuishy/elements/effects/EffGlowColor.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,58 @@ | ||
package lol.aabss.skuishy.elements.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.ParseResult; | ||
import ch.njol.skript.util.Color; | ||
import ch.njol.util.Kleenean; | ||
import lol.aabss.skuishy.other.Glow; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Event; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
@Name("Player - Glow Color") | ||
@Description("Makes a player glow a color") | ||
@Examples({ | ||
"make player glow red", | ||
"wait 10 seconds", | ||
"make player stop glowing " | ||
}) | ||
@Since("1.4") | ||
|
||
public class EffGlowColor extends Effect { | ||
|
||
static { | ||
Skript.registerEffect(EffGlowColor.class, | ||
"make %players% glow %color%" | ||
); | ||
} | ||
|
||
private Expression<Player> player; | ||
private Expression<Color> color; | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parser) { | ||
player = (Expression<Player>) expressions[0]; | ||
color = (Expression<Color>) expressions[1]; | ||
return true; | ||
} | ||
|
||
@Override | ||
public @NotNull String toString(@Nullable Event event, boolean debug) { | ||
return "make " + player + " glowing " + color; | ||
} | ||
|
||
@Override | ||
protected void execute(@NotNull Event event) { | ||
Player p = player.getSingle(event); | ||
Glow.mainGlow(p, color, event); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/lol/aabss/skuishy/elements/effects/EffStopGlow.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,59 @@ | ||
package lol.aabss.skuishy.elements.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.ParseResult; | ||
import ch.njol.util.Kleenean; | ||
import org.bukkit.Bukkit; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.scoreboard.Scoreboard; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
@Name("Player - Stop Glowing") | ||
@Description("Makes a player stop glowing") | ||
@Examples({ | ||
"make player glow red", | ||
"wait 10 seconds", | ||
"make player stop glowing" | ||
}) | ||
@Since("1.4") | ||
|
||
public class EffStopGlow extends Effect { | ||
|
||
static { | ||
Skript.registerEffect(EffStopGlow.class, | ||
"make %players% stop glow[ing]", "[skuishy] remove glowing from %player%" | ||
); | ||
} | ||
|
||
private Expression<Player> player; | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public boolean init(Expression<?>[] expressions, int matchedPattern, @NotNull Kleenean isDelayed, @NotNull ParseResult parser) { | ||
player = (Expression<Player>) expressions[0]; | ||
return true; | ||
} | ||
|
||
@Override | ||
public @NotNull String toString(@Nullable Event event, boolean debug) { | ||
return "make " + player + " stop glowing"; | ||
} | ||
|
||
@Override | ||
protected void execute(@NotNull Event event) { | ||
Player p = player.getSingle(event); | ||
assert p != null; | ||
Scoreboard mainScoreboard = Bukkit.getScoreboardManager().getMainScoreboard(); | ||
mainScoreboard.getTeams().forEach(team -> team.removeEntry(p.getName())); | ||
p.setGlowing(false); | ||
} | ||
} |
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
Oops, something went wrong.