Skip to content

Commit

Permalink
1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
aabssmc committed Nov 7, 2023
1 parent 0045a78 commit 9f56415
Show file tree
Hide file tree
Showing 19 changed files with 467 additions and 49 deletions.
7 changes: 7 additions & 0 deletions .gitignore
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/
6 changes: 0 additions & 6 deletions .idea/.gitignore

This file was deleted.

13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'lol.aabss'
version = '1.3'
version = '1.4'

repositories {
mavenCentral()
Expand All @@ -15,11 +15,14 @@ repositories {
maven {
url = 'https://repo.skriptlang.org/releases'
}
maven {
url = 'https://jitpack.io'
}
}

dependencies {
compileOnly 'io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT'
implementation (group: 'com.github.SkriptLang', name: 'Skript', version: '2.7.1') {
implementation (group: 'com.github.SkriptLang', name: 'Skript', version: '2.7.2') {
transitive = false
}
implementation (group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1')
Expand Down Expand Up @@ -48,4 +51,8 @@ processResources {
filesMatching('plugin.yml') {
expand props
}
}
from ('lang') {
include '**/*'
into 'lang/'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public class CondMainHand extends Condition {
enum MainHandSide {
LEFT, RIGHT
}


static {
Skript.registerCondition(CondMainHand.class,
"%players%'s main hand (0:is|1:is( not|n't)) (:left|:right)",
Expand Down
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);
}
}
}
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 src/main/java/lol/aabss/skuishy/elements/effects/EffGlowColor.java
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 src/main/java/lol/aabss/skuishy/elements/effects/EffStopGlow.java
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ExprMainHand extends PropertyExpression<Player, String> {

static {
register(ExprMainHand.class, String.class,
"[the] main[(-| )]hand",
"main[(-| )]hand",
"players"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@

import java.awt.image.BufferedImage;

@Name("Skins - Face of Player")
@Description("Gets the player's face.")
@Name("Skins - Face of Player as image")
@Description("Gets the player's face as image.")
@Examples({
"command face-texture <player>:",
"\ttrigger:",
"\t\tset {_texture} to arg-1 face at size 10 with an outer layer",
"\t\tset {_texture} to face with a layer of player"
"\t\tset {_texture} to arg-1's face at size 8 with an outer layer as image"
})
@Since("1.0")


public class ExprPlayerFace extends PropertyExpression<Player, BufferedImage> {
public class ExprPlayerFaceImg extends PropertyExpression<Player, BufferedImage> {

static {
register(ExprPlayerFace.class, BufferedImage.class,
"face [(at|with) size %-number%] (:with|:without) (a|an) [outer[( |-)]]layer",
register(ExprPlayerFaceImg.class, BufferedImage.class,
"face [(at|with) size %-number%] (:with|:without) (a|an) [outer[( |-)]]layer as image",
"players"
);
}
Expand Down Expand Up @@ -64,10 +63,10 @@ public class ExprPlayerFace extends PropertyExpression<Player, BufferedImage> {
public @NotNull String toString(Event event, boolean debug) {
if (this.size != null) {
return Classes.getDebugMessage(getExpr()) + "'face with size " + this.size.toString(event, debug) +
(without ? " without" : " with") + " an layer";
(without ? " without" : " with") + " an layer as image";
}
return Classes.getDebugMessage(getExpr()) + "'face " +
(without ? "without" : "with") + " an layer";
(without ? "without" : "with") + " an layer as image";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class ExprPlayerSig extends PropertyExpression<Player, String> {

static {
register(ExprPlayerSig.class, String.class, "[the] (texture|skin) signature", "players");
register(ExprPlayerSig.class, String.class, "(texture|skin) signature", "players");
}


Expand Down
Loading

0 comments on commit 9f56415

Please sign in to comment.