Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 063dbec

Browse files
committed
Final Commit (hopefully)
1 parent 859dc77 commit 063dbec

34 files changed

+196
-335
lines changed

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ tasks {
9797

9898
downloadPlugins {
9999
url("https://download.luckperms.net/1552/bukkit/loader/LuckPerms-Bukkit-5.4.137.jar")
100-
url("https://ci.lucko.me/job/spark/439/artifact/spark-bukkit/build/libs/spark-1.10.93-bukkit.jar")
101100
url("https://github.com/SkriptLang/Skript/releases/download/2.9.1/Skript-2.9.1.jar")
102101
url("https://github.com/dmulloy2/ProtocolLib/releases/download/5.2.0/ProtocolLib.jar")
103102
url("https://github.com/LoneDev6/SpigotUtilities/raw/master/LoneLibs.jar")

src/main/java/me/asleepp/SkriptItemsAdder/SkriptItemsAdder.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@
44

55
import ch.njol.skript.util.Version;
66
import lombok.Getter;
7-
import lombok.Setter;
8-
import me.asleepp.SkriptItemsAdder.other.aliases.AliasesGenerator;
9-
import me.asleepp.SkriptItemsAdder.other.listeners.ItemsAdderEventListener;
10-
import me.asleepp.SkriptItemsAdder.other.util.Metrics;
11-
import me.asleepp.SkriptItemsAdder.other.util.SkriptItemsAdderCommand;
12-
import me.asleepp.SkriptItemsAdder.other.util.UpdateChecker;
13-
import me.asleepp.SkriptItemsAdder.other.util.Util;
7+
import me.asleepp.SkriptItemsAdder.aliases.AliasesGenerator;
8+
import me.asleepp.SkriptItemsAdder.listeners.ItemsAdderEventListener;
9+
import me.asleepp.SkriptItemsAdder.util.Metrics;
10+
import me.asleepp.SkriptItemsAdder.util.SkriptItemsAdderCommand;
11+
import me.asleepp.SkriptItemsAdder.util.UpdateChecker;
12+
import me.asleepp.SkriptItemsAdder.util.Util;
1413
import org.bukkit.plugin.Plugin;
1514
import org.bukkit.plugin.PluginManager;
1615
import org.bukkit.plugin.java.JavaPlugin;
1716

1817
import ch.njol.skript.Skript;
1918
import ch.njol.skript.SkriptAddon;
20-
import org.bukkit.scheduler.BukkitRunnable;
2119

2220
import javax.annotation.Nullable;
2321

@@ -49,7 +47,7 @@ public void onEnable() {
4947
getLogger().severe("Could not find Skript! Disabling...");
5048
manager.disablePlugin(this);
5149
return;
52-
} else if (Skript.getVersion().compareTo(new Version(2, 7, 0)) < 0) {
50+
} else if (Skript.getVersion().isSmallerThan(new Version(2, 7, 0))) {
5351
getLogger().severe("You are running an unsupported version of Skript. Disabling...");
5452
manager.disablePlugin(this);
5553
return;

src/main/java/me/asleepp/SkriptItemsAdder/other/aliases/AliasesGenerator.java renamed to src/main/java/me/asleepp/SkriptItemsAdder/aliases/AliasesGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package me.asleepp.SkriptItemsAdder.other.aliases;
1+
package me.asleepp.SkriptItemsAdder.aliases;
22

33
import ch.njol.skript.Skript;
44
import ch.njol.skript.aliases.Aliases;

src/main/java/me/asleepp/SkriptItemsAdder/other/aliases/CustomItemType.java renamed to src/main/java/me/asleepp/SkriptItemsAdder/aliases/CustomItemType.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package me.asleepp.SkriptItemsAdder.other.aliases;
1+
package me.asleepp.SkriptItemsAdder.aliases;
22

33
import lombok.Getter;
44
import lombok.Setter;
@@ -13,6 +13,8 @@ public class CustomItemType {
1313

1414
private String namespacedID;
1515

16+
public CustomItemType() { }
17+
1618
public CustomItemType(String namespacedID) {
1719
this.namespacedID = namespacedID;
1820
}

src/main/java/me/asleepp/SkriptItemsAdder/elements/conditions/CondCooldown.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/main/java/me/asleepp/SkriptItemsAdder/elements/conditions/CondGetAction.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/main/java/me/asleepp/SkriptItemsAdder/elements/conditions/CondGetBlockFace.java

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/main/java/me/asleepp/SkriptItemsAdder/elements/conditions/CondHUDExists.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public boolean check(Event event) {
3333
String id = hudID.getSingle(event);
3434
Player[] playersArray = players != null ? players.getArray(event) : new Player[]{};
3535

36-
if (id != null && playersArray.length > 0) {
36+
if (id != null) {
3737
for (Player player : playersArray) {
3838
PlayerHudsHolderWrapper hudHolder = new PlayerHudsHolderWrapper(player);
3939
PlayerHudWrapper hudWrapper = new PlayerHudWrapper(hudHolder, id);

src/main/java/me/asleepp/SkriptItemsAdder/elements/conditions/CondHUDIsVisible.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
package me.asleepp.SkriptItemsAdder.elements.conditions;
22

33
import ch.njol.skript.Skript;
4+
import ch.njol.skript.doc.Description;
5+
import ch.njol.skript.doc.Examples;
6+
import ch.njol.skript.doc.Name;
7+
import ch.njol.skript.doc.RequiredPlugins;
8+
import ch.njol.skript.doc.Since;
49
import ch.njol.skript.lang.Condition;
510
import ch.njol.skript.lang.Expression;
611
import ch.njol.skript.lang.SkriptParser;
@@ -12,6 +17,11 @@
1217

1318
import javax.annotation.Nullable;
1419

20+
@Name("HUD Is Visible")
21+
@Description("Determines whether players can see a hud/if a hud is active.")
22+
@Examples("if player can see itemsadder hud \"namespaced:id\"")
23+
@Since("1.6")
24+
@RequiredPlugins("ItemsAdder")
1525
public class CondHUDIsVisible extends Condition {
1626

1727
private Expression<Player> players;
@@ -33,7 +43,7 @@ public boolean check(Event event) {
3343
Player[] p = players.getArray(event);
3444
String id = hudID.getSingle(event);
3545

36-
if (p != null && id != null) {
46+
if (id != null) {
3747
for (Player players : p) {
3848
PlayerHudsHolderWrapper hudsHolder = new PlayerHudsHolderWrapper(players);
3949
PlayerHudWrapper hudWrapper = new PlayerHudWrapper(hudsHolder, id);
@@ -46,6 +56,6 @@ public boolean check(Event event) {
4656

4757
@Override
4858
public String toString(@Nullable Event event, boolean debug) {
49-
return "player(s) " + players.toString(event, debug) + "can view itemsadder hud " + hudID.toString(event, debug);
59+
return players.toString(event, debug) + "can view itemsadder hud " + hudID.toString(event, debug);
5060
}
5161
}

src/main/java/me/asleepp/SkriptItemsAdder/elements/conditions/CondIsCustomBlock.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
import ch.njol.skript.lang.SkriptParser;
1212
import ch.njol.util.Kleenean;
1313
import dev.lone.itemsadder.api.CustomBlock;
14-
import me.asleepp.SkriptItemsAdder.other.aliases.CustomItemType;
14+
import me.asleepp.SkriptItemsAdder.aliases.CustomItemType;
1515
import org.bukkit.block.Block;
1616
import org.bukkit.event.Event;
1717

1818
import javax.annotation.Nullable;
19-
import java.util.Arrays;
2019
import java.util.List;
2120
import java.util.stream.Collectors;
2221

@@ -39,7 +38,7 @@ public class CondIsCustomBlock extends Condition {
3938
static {
4039
Skript.registerCondition(CondIsCustomBlock.class,
4140
"%blocks% (is [a[n]]|are) [custom] (ia|itemsadder) block[s] [[with id] %-customitemtypes/strings%]",
42-
"%blocks% (is[n't| not]) [a] [custom] (ia|itemsadder) block[s] [[with id] %-customitemtypes/strings%]");
41+
"%blocks% (isn't|is not|aren't|are not) [a] [custom] (ia|itemsadder) block[s] [[with id] %-customitemtypes/strings%]");
4342
}
4443

4544
@SuppressWarnings("unchecked")
@@ -53,7 +52,7 @@ public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean is
5352

5453
@Override
5554
public boolean check(Event event) {
56-
List<String> expectedIds = Arrays.stream(ids.getArray(event))
55+
List<String> expectedIds = ids.stream(event)
5756
.map(id -> {
5857
if (id instanceof CustomItemType) {
5958
return ((CustomItemType) id).getNamespacedID();

0 commit comments

Comments
 (0)