This repository has been archived by the owner on Jul 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
8 changed files
with
160 additions
and
38 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package pl.pickaxe.largesk.aac; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Event; | ||
import javax.annotation.Nullable; | ||
|
||
import ch.njol.skript.lang.Condition; | ||
import ch.njol.skript.lang.Expression; | ||
import ch.njol.skript.lang.SkriptParser.ParseResult; | ||
import ch.njol.util.Kleenean; | ||
import me.konsolas.aac.api.AACAPIProvider; | ||
|
||
public class CondOnGround extends Condition { | ||
|
||
private Expression<Player> p; | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public boolean init(Expression<?>[] e, int arg1, Kleenean arg2, ParseResult arg3) { | ||
p = (Expression<Player>) e[0]; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event arg0, boolean arg1) { | ||
return "aac player on ground"; | ||
} | ||
|
||
@Override | ||
public boolean check(Event e) { | ||
if (AACAPIProvider.isAPILoaded() && AACAPIProvider.getAPI().isPlayerOnGround(p.getSingle(e))) | ||
{ | ||
return true; | ||
} | ||
else | ||
{ | ||
return 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pl.pickaxe.largesk.aac; | ||
|
||
import org.bukkit.event.Event; | ||
import javax.annotation.Nullable; | ||
|
||
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 me.konsolas.aac.api.AACAPIProvider; | ||
|
||
public class EffReloadPermissionCache extends Effect { | ||
|
||
@Override | ||
public boolean init(Expression<?>[] arg0, int arg1, Kleenean arg2, ParseResult arg3) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event arg0, boolean arg1) { | ||
return "aac reload permission cache"; | ||
} | ||
|
||
@Override | ||
protected void execute(Event arg0) { | ||
if (AACAPIProvider.isAPILoaded() == true) { | ||
AACAPIProvider.getAPI().reloadPermissionCache(); | ||
} | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package pl.pickaxe.largesk.aac; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.Event; | ||
import javax.annotation.Nullable; | ||
|
||
import ch.njol.skript.lang.Expression; | ||
import ch.njol.skript.lang.SkriptParser.ParseResult; | ||
import ch.njol.skript.lang.util.SimpleExpression; | ||
import ch.njol.util.Kleenean; | ||
import me.konsolas.aac.api.AACAPIProvider; | ||
|
||
public class ExprAacPing extends SimpleExpression<Integer> | ||
{ | ||
// full time of %world% | ||
|
||
private Expression<Player> player; | ||
|
||
@Override | ||
public Class<? extends Integer> getReturnType() | ||
{ | ||
return Integer.class; | ||
} | ||
|
||
@Override | ||
public boolean isSingle() | ||
{ | ||
return true; | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
@Override | ||
public boolean init(Expression<?>[] expr, int arg1, Kleenean arg2, ParseResult arg3) | ||
{ | ||
player = (Expression<Player>) expr[0]; | ||
return true; | ||
} | ||
|
||
@Override | ||
public String toString(@Nullable Event arg0, boolean arg1) | ||
{ | ||
return "full time"; | ||
} | ||
|
||
@Override | ||
@Nullable | ||
protected Integer[] get(Event e) | ||
{ | ||
if (AACAPIProvider.isAPILoaded()) | ||
{ | ||
return new Integer[]{AACAPIProvider.getAPI().getPing(player.getSingle(e))}; | ||
} | ||
else | ||
{ | ||
return new Integer[]{0}; | ||
} | ||
} | ||
|
||
} |