diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index fc6081e..24d5b2b 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -16,12 +16,12 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2.3.4
+ - uses: actions/checkout@v4
- - uses: actions/setup-java@v2.3.0
+ - uses: actions/setup-java@v4
with:
- distribution: adopt
- java-version: '8'
+ distribution: 'temurin'
+ java-version: '17'
cache: 'maven'
- run: mvn package --file pom.xml
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 719e222..bdc8c14 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -13,14 +13,14 @@ jobs:
if: github.repository_owner == 'Mooy1'
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2.3.4
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
- - uses: actions/setup-java@v2.3.0
+ - uses: actions/setup-java@v4
with:
- distribution: adopt
- java-version: '8'
+ distribution: 'temurin'
+ java-version: '17'
cache: 'maven'
- run: mvn package --file pom.xml
@@ -29,7 +29,7 @@ jobs:
run: |
newVersion=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo New Version: $newVersion
- echo ::set-output name=new-version::$newVersion
+ echo "new-version=$newVersion" >> $GITHUB_OUTPUT
# Modified From: https://github.com/Bullrich/generate-release-changelog
tag=$(git tag | sort -r --version-sort | head -n1)
@@ -42,25 +42,24 @@ jobs:
fi
echo Old Version: $tag
- echo ::set-output name=old-version::$tag
+ echo "old-version=$tag" >> $GITHUB_OUTPUT
changelog="${changelog//'%'/'%25'}"
changelog="${changelog//$'\n'/'%0A' - }"
changelog=" - ${changelog//$'\r'/'%0D'}"
echo "$changelog"
- echo ::set-output name=changelog::$changelog
+ echo "changelog=$changelog" >> $GITHUB_OUTPUT
- - uses: madhead/semver-utils@1.4.3
+ - uses: madhead/semver-utils@latest
id: comparison
with:
version: ${{ steps.run.outputs.new-version }}
compare-to: ${{ steps.run.outputs.old-version }}
- - uses: actions/create-release@v1.1.4
+ - uses: softprops/action-gh-release@v1
if: steps.comparison.outputs.comparison-result == '>'
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.run.outputs.new-version }}
- release_name: Release v${{ steps.run.outputs.new-version }}
+ name: Release v${{ steps.run.outputs.new-version }}
body: ${{ steps.run.outputs.changelog }}
+ token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml
index 135725a..a3c2ae3 100644
--- a/.github/workflows/version.yml
+++ b/.github/workflows/version.yml
@@ -13,7 +13,7 @@ jobs:
if: github.repository_owner == 'Mooy1'
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2.3.4
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -21,7 +21,7 @@ jobs:
run: |
newVersion=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo New Version: $newVersion
- echo ::set-output name=new-version::$newVersion
+ echo "new-version=$newVersion" >> $GITHUB_OUTPUT
tag=$(git tag | sort -r --version-sort | head -n1)
@@ -30,9 +30,9 @@ jobs:
fi
echo Old Version: $tag
- echo ::set-output name=old-version::$tag
+ echo "old-version=$tag" >> $GITHUB_OUTPUT
- - uses: madhead/semver-utils@1.4.3
+ - uses: madhead/semver-utils@latest
id: comparison
with:
version: ${{ steps.run.outputs.new-version }}
diff --git a/pom.xml b/pom.xml
index 1cfc8ef..06684f4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,11 +6,11 @@
4.0.0
io.github.mooy1
InfinityLib
- 1.3.10
+ 1.3.11
- 1.8
- 1.8
+ 17
+ 17
UTF-8
@@ -24,27 +24,25 @@
spigot-repo
https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
+ papermc
+ https://repo.papermc.io/repository/maven-public/
+
-
- org.spigotmc
- spigot-api
- 1.17.1-R0.1-SNAPSHOT
- provided
-
-
io.github.Slimefun
Slimefun4
- RC-28
+ experimental-SNAPSHOT
provided
org.projectlombok
lombok
- 1.18.20
+ 1.18.30
provided
@@ -58,21 +56,63 @@
org.bstats
bstats-bukkit
- 2.2.1
+ 3.1.0
compile
+
+ org.spigotmc
+ spigot-api
+ 1.21.4-R0.1-SNAPSHOT
+ provided
+
+
+
+ io.papermc.paper
+ paper-api
+ 1.21.4-R0.1-SNAPSHOT
+ test
+
+
org.junit.jupiter
- junit-jupiter
- 5.7.2
+ junit-jupiter-api
+ 5.10.2
test
- com.github.seeseemelk
- MockBukkit-v1.16
- 1.5.0
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.10.2
+ test
+
+
+
+ org.junit.platform
+ junit-platform-console
+ 1.9.3
+ test
+
+
+
+ org.junit.platform
+ junit-platform-launcher
+ 1.9.3
+ test
+
+
+
+ org.junit.platform
+ junit-platform-suite-api
+ 1.9.3
+ test
+
+
+
+ com.github.MockBukkit
+ MockBukkit
+ v1.21-SNAPSHOT
test
@@ -129,10 +169,21 @@
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.11.0
+
+ ${maven.compiler.source}
+ ${maven.compiler.target}
+ ${project.build.sourceEncoding}
+
+
+
org.apache.maven.plugins
maven-shade-plugin
- 3.2.4
+ 3.5.1
@@ -161,4 +212,12 @@
-
\ No newline at end of file
+
+
+
+ github
+ GitHub Packages
+ https://maven.pkg.github.com/alexsvorada/InfinityLib
+
+
+
diff --git a/src/main/java/io/github/mooy1/infinitylib/commands/HelpCommand.java b/src/main/java/io/github/mooy1/infinitylib/commands/HelpCommand.java
index 9f17b48..f1cbe95 100644
--- a/src/main/java/io/github/mooy1/infinitylib/commands/HelpCommand.java
+++ b/src/main/java/io/github/mooy1/infinitylib/commands/HelpCommand.java
@@ -4,7 +4,6 @@
import javax.annotation.ParametersAreNonnullByDefault;
-import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import io.github.thebusybiscuit.slimefun4.libraries.dough.common.ChatColors;
@@ -25,7 +24,7 @@ public void execute(CommandSender sender, String[] args) {
sender.sendMessage(ChatColors.color("&7----------&b /" + command.fullName() + " Help &7----------"));
sender.sendMessage("");
for (SubCommand sub : command.available(sender)) {
- sender.sendMessage("/" + sub.fullName() + ChatColor.YELLOW + " - " + sub.description());
+ sender.sendMessage("/" + sub.fullName() + ChatColors.color("&7") + " - " + sub.description());
}
sender.sendMessage("");
}
diff --git a/src/main/java/io/github/mooy1/infinitylib/common/PersistentType.java b/src/main/java/io/github/mooy1/infinitylib/common/PersistentType.java
index 2bc05a0..09ddbc3 100644
--- a/src/main/java/io/github/mooy1/infinitylib/common/PersistentType.java
+++ b/src/main/java/io/github/mooy1/infinitylib/common/PersistentType.java
@@ -51,7 +51,7 @@ public final class PersistentType implements PersistentDataType {
}
catch (Exception e) {
e.printStackTrace();
- return new CustomItemStack(Material.STONE, "&cERROR");
+ return CustomItemStack.create(Material.STONE, "&cERROR");
}
}
);
@@ -157,10 +157,10 @@ public final class PersistentType implements PersistentDataType {
}
catch (InvalidConfigurationException e) {
e.printStackTrace();
- return new CustomItemStack(Material.STONE, "&cERROR");
+ return CustomItemStack.create(Material.STONE, "&cERROR");
}
ItemStack item = config.getItemStack("item");
- return item != null ? item : new CustomItemStack(Material.STONE, "&cERROR");
+ return item != null ? item : CustomItemStack.create(Material.STONE, "&cERROR");
}
);
diff --git a/src/main/java/io/github/mooy1/infinitylib/common/StackUtils.java b/src/main/java/io/github/mooy1/infinitylib/common/StackUtils.java
index c049c10..f437c2d 100644
--- a/src/main/java/io/github/mooy1/infinitylib/common/StackUtils.java
+++ b/src/main/java/io/github/mooy1/infinitylib/common/StackUtils.java
@@ -13,7 +13,6 @@
import org.bukkit.persistence.PersistentDataType;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
-import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
@UtilityClass
@@ -24,8 +23,9 @@ public final class StackUtils {
@Nullable
public static String getId(ItemStack item) {
- if (item instanceof SlimefunItemStack) {
- return ((SlimefunItemStack) item).getItemId();
+ SlimefunItem sfItem = SlimefunItem.getByItem(item);
+ if (sfItem != null) {
+ return sfItem.getId();
} else if (item.hasItemMeta()) {
return getId(item.getItemMeta());
} else {
@@ -40,8 +40,9 @@ public static String getId(ItemMeta meta) {
@Nonnull
public static String getIdOrType(ItemStack item) {
- if (item instanceof SlimefunItemStack) {
- return ((SlimefunItemStack) item).getItemId();
+ SlimefunItem sfItem = SlimefunItem.getByItem(item);
+ if (sfItem != null) {
+ return sfItem.getId();
} else if (item.hasItemMeta()) {
String id = getId(item.getItemMeta());
return id == null ? item.getType().name() : id;
diff --git a/src/main/java/io/github/mooy1/infinitylib/core/AddonConfig.java b/src/main/java/io/github/mooy1/infinitylib/core/AddonConfig.java
index c2e14c9..7098559 100644
--- a/src/main/java/io/github/mooy1/infinitylib/core/AddonConfig.java
+++ b/src/main/java/io/github/mooy1/infinitylib/core/AddonConfig.java
@@ -111,7 +111,7 @@ protected String buildHeader() {
@Nonnull
@Override
public String saveToString() {
- options().copyDefaults(true).copyHeader(false).indent(2);
+ options().copyDefaults(true).parseComments(true).indent(2);
String defaultSave = super.saveToString();
try {
diff --git a/src/main/java/io/github/mooy1/infinitylib/machines/CraftingBlock.java b/src/main/java/io/github/mooy1/infinitylib/machines/CraftingBlock.java
index 7db633b..3984b38 100644
--- a/src/main/java/io/github/mooy1/infinitylib/machines/CraftingBlock.java
+++ b/src/main/java/io/github/mooy1/infinitylib/machines/CraftingBlock.java
@@ -29,7 +29,7 @@
@ParametersAreNonnullByDefault
public class CraftingBlock extends MenuBlock {
- public static final ItemStack CLICK_TO_CRAFT = new CustomItemStack(Material.LIME_STAINED_GLASS_PANE, "&aClick To Craft!");
+ public static final ItemStack CLICK_TO_CRAFT = CustomItemStack.create(Material.LIME_STAINED_GLASS_PANE, "&aClick To Craft!");
@Setter
protected MachineLayout layout = MachineLayout.CRAFTING_DEFAULT;
diff --git a/src/main/java/io/github/mooy1/infinitylib/machines/MenuBlock.java b/src/main/java/io/github/mooy1/infinitylib/machines/MenuBlock.java
index 3ca5ecf..3cd6a9d 100644
--- a/src/main/java/io/github/mooy1/infinitylib/machines/MenuBlock.java
+++ b/src/main/java/io/github/mooy1/infinitylib/machines/MenuBlock.java
@@ -29,12 +29,12 @@
@ParametersAreNonnullByDefault
public abstract class MenuBlock extends SlimefunItem {
- public static final ItemStack PROCESSING_ITEM = new CustomItemStack(Material.LIME_STAINED_GLASS_PANE, "&aProcessing...");
- public static final ItemStack NO_ENERGY_ITEM = new CustomItemStack(Material.RED_STAINED_GLASS_PANE, "&cNot enough energy!");
- public static final ItemStack IDLE_ITEM = new CustomItemStack(Material.BLACK_STAINED_GLASS_PANE, "&8Idle");
- public static final ItemStack NO_ROOM_ITEM = new CustomItemStack(Material.ORANGE_STAINED_GLASS_PANE, "&6Not enough room!");
- public static final ItemStack OUTPUT_BORDER = new CustomItemStack(ChestMenuUtils.getOutputSlotTexture(), "&6Output");
- public static final ItemStack INPUT_BORDER = new CustomItemStack(ChestMenuUtils.getInputSlotTexture(), "&9Input");
+ public static final ItemStack PROCESSING_ITEM = CustomItemStack.create(Material.LIME_STAINED_GLASS_PANE, "&aProcessing...");
+ public static final ItemStack NO_ENERGY_ITEM = CustomItemStack.create(Material.RED_STAINED_GLASS_PANE, "&cNot enough energy!");
+ public static final ItemStack IDLE_ITEM = CustomItemStack.create(Material.BLACK_STAINED_GLASS_PANE, "&8Idle");
+ public static final ItemStack NO_ROOM_ITEM = CustomItemStack.create(Material.ORANGE_STAINED_GLASS_PANE, "&6Not enough room!");
+ public static final ItemStack OUTPUT_BORDER = CustomItemStack.create(ChestMenuUtils.getOutputSlotTexture(), "&6Output");
+ public static final ItemStack INPUT_BORDER = CustomItemStack.create(ChestMenuUtils.getInputSlotTexture(), "&9Input");
public static final ItemStack BACKGROUND_ITEM = ChestMenuUtils.getBackground();
public MenuBlock(ItemGroup category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
diff --git a/src/test/java/io/github/mooy1/infinitylib/commands/TestAddonCommand.java b/src/test/java/io/github/mooy1/infinitylib/commands/TestAddonCommand.java
index 04f08b8..d8ad041 100644
--- a/src/test/java/io/github/mooy1/infinitylib/commands/TestAddonCommand.java
+++ b/src/test/java/io/github/mooy1/infinitylib/commands/TestAddonCommand.java
@@ -9,9 +9,10 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.ServerMock;
-import be.seeseemelk.mockbukkit.entity.PlayerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.ServerMock;
+import org.mockbukkit.mockbukkit.command.CommandResult;
+import org.mockbukkit.mockbukkit.entity.PlayerMock;
import io.github.mooy1.infinitylib.core.AbstractAddon;
import io.github.mooy1.infinitylib.core.MockAddon;
@@ -19,6 +20,7 @@
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertNull;
class TestAddonCommand {
@@ -153,11 +155,13 @@ private static String getResponse(PlayerMock p, String... args) {
}
private static void assertResponse(CommandSender sender, String... args) {
- server.execute(command, sender, args).assertResponse(args[args.length - 1]);
+ CommandResult result = server.execute(command, sender, args);
+ assertEquals(args[args.length - 1], result.getSender().nextMessage());
}
private static void assertNoResponse(CommandSender sender, String... args) {
- server.execute(command, sender, args).assertNoResponse();
+ CommandResult result = server.execute(command, sender, args);
+ assertNull(result.getSender().nextMessage());
}
private static void assertCompletion(CommandSender sender, String completion, String... args) {
diff --git a/src/test/java/io/github/mooy1/infinitylib/common/TestCoolDowns.java b/src/test/java/io/github/mooy1/infinitylib/common/TestCoolDowns.java
index 6a38842..1b656a4 100644
--- a/src/test/java/io/github/mooy1/infinitylib/common/TestCoolDowns.java
+++ b/src/test/java/io/github/mooy1/infinitylib/common/TestCoolDowns.java
@@ -6,8 +6,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.ServerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.ServerMock;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
diff --git a/src/test/java/io/github/mooy1/infinitylib/common/TestEvents.java b/src/test/java/io/github/mooy1/infinitylib/common/TestEvents.java
index 633343f..dd2dd52 100644
--- a/src/test/java/io/github/mooy1/infinitylib/common/TestEvents.java
+++ b/src/test/java/io/github/mooy1/infinitylib/common/TestEvents.java
@@ -9,7 +9,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.MockBukkit;
import io.github.mooy1.infinitylib.core.MockAddon;
import static io.github.mooy1.infinitylib.common.Events.addHandler;
@@ -35,7 +35,7 @@ public static void unload() {
@Test
void testCallEvent() {
call(new MockEvent());
- MockBukkit.getMock().getPluginManager().assertEventFired(MockEvent.class);
+ assertTrue(MockBukkit.getMock().getPluginManager().getFiredEvents().anyMatch(e -> e instanceof MockEvent));
}
@Test
diff --git a/src/test/java/io/github/mooy1/infinitylib/common/TestPersistentType.java b/src/test/java/io/github/mooy1/infinitylib/common/TestPersistentType.java
index b5d28c9..46c4b3f 100644
--- a/src/test/java/io/github/mooy1/infinitylib/common/TestPersistentType.java
+++ b/src/test/java/io/github/mooy1/infinitylib/common/TestPersistentType.java
@@ -14,10 +14,10 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.ServerMock;
-import be.seeseemelk.mockbukkit.WorldMock;
-import be.seeseemelk.mockbukkit.persistence.PersistentDataContainerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.ServerMock;
+import org.mockbukkit.mockbukkit.world.WorldMock;
+import org.mockbukkit.mockbukkit.persistence.PersistentDataContainerMock;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -47,7 +47,7 @@ void testItemStack() {
container.set(key, PersistentType.ITEM_STACK, item);
assertEquals(item, container.get(key, PersistentType.ITEM_STACK));
- item = SlimefunItems.ANCIENT_ALTAR;
+ item = SlimefunItems.ANCIENT_ALTAR.item();
container.set(key, PersistentType.ITEM_STACK, item);
assertEquals(item, container.get(key, PersistentType.ITEM_STACK));
}
@@ -56,12 +56,12 @@ void testItemStack() {
@Disabled(value = "MockBukkit issue")
void testItemStackOld() {
ItemStack item = new ItemStack(Material.OBSIDIAN);
- container.set(key, PersistentType.ITEM_STACK_OLD, item);
- assertEquals(item, container.get(key, PersistentType.ITEM_STACK_OLD));
+ container.set(key, PersistentType.ITEM_STACK, item);
+ assertEquals(item, container.get(key, PersistentType.ITEM_STACK));
- item = SlimefunItems.ANCIENT_ALTAR;
- container.set(key, PersistentType.ITEM_STACK_OLD, item);
- assertEquals(item, container.get(key, PersistentType.ITEM_STACK_OLD));
+ item = SlimefunItems.ANCIENT_ALTAR.item();
+ container.set(key, PersistentType.ITEM_STACK, item);
+ assertEquals(item, container.get(key, PersistentType.ITEM_STACK));
}
@Test
@@ -71,7 +71,7 @@ void testItemStackList() {
container.set(key, PersistentType.ITEM_STACK_LIST, list);
assertEquals(list, container.get(key, PersistentType.ITEM_STACK_LIST));
- list = Arrays.asList(new ItemStack(Material.PUMPKIN), SlimefunItems.ADVANCED_CIRCUIT_BOARD);
+ list = Arrays.asList(new ItemStack(Material.PUMPKIN), SlimefunItems.ADVANCED_CIRCUIT_BOARD.item());
container.set(key, PersistentType.ITEM_STACK_LIST, list);
assertEquals(list, container.get(key, PersistentType.ITEM_STACK_LIST));
}
diff --git a/src/test/java/io/github/mooy1/infinitylib/common/TestScheduler.java b/src/test/java/io/github/mooy1/infinitylib/common/TestScheduler.java
index 76e61d9..f37b7b6 100644
--- a/src/test/java/io/github/mooy1/infinitylib/common/TestScheduler.java
+++ b/src/test/java/io/github/mooy1/infinitylib/common/TestScheduler.java
@@ -9,8 +9,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.scheduler.BukkitSchedulerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.scheduler.BukkitSchedulerMock;
import io.github.mooy1.infinitylib.core.MockAddon;
import static io.github.mooy1.infinitylib.common.Scheduler.repeat;
diff --git a/src/test/java/io/github/mooy1/infinitylib/common/TestStackUtils.java b/src/test/java/io/github/mooy1/infinitylib/common/TestStackUtils.java
index a0ce61d..ccb5ed2 100644
--- a/src/test/java/io/github/mooy1/infinitylib/common/TestStackUtils.java
+++ b/src/test/java/io/github/mooy1/infinitylib/common/TestStackUtils.java
@@ -6,7 +6,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.MockBukkit;
import io.github.thebusybiscuit.slimefun4.core.services.CustomItemDataService;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
@@ -39,7 +39,7 @@ public static void unload() {
@Test
void testGetId() {
CustomItemDataService dataService = Slimefun.getItemDataService();
- ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD;
+ ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD.item();
ItemStack item2 = new ItemStack(Material.IRON_BLOCK);
assertEquals(getId(item1), dataService.getItemData(item1).orElse(null));
@@ -51,7 +51,7 @@ void testGetId() {
@Test
void testGetIdOrType() {
CustomItemDataService dataService = Slimefun.getItemDataService();
- ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD;
+ ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD.item();
ItemStack item2 = new ItemStack(Material.IRON_BLOCK);
assertEquals(getIdOrType(item1), dataService.getItemData(item1).orElse(item1.getType().name()));
@@ -60,7 +60,7 @@ void testGetIdOrType() {
@Test
void testItemById() {
- ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD;
+ ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD.item();
String id1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD.getItemId();
String id2 = Material.IRON_BLOCK.name();
@@ -70,7 +70,7 @@ void testItemById() {
@Test
void testItemByIdOrType() {
- ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD;
+ ItemStack item1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD.item();
ItemStack item2 = new ItemStack(Material.IRON_BLOCK);
String id1 = SlimefunItems.ADVANCED_CIRCUIT_BOARD.getItemId();
String id2 = item2.getType().name();
@@ -85,9 +85,9 @@ void testIsSimilar() {
ItemStack air = new ItemStack(Material.AIR);
ItemStack stone = new ItemStack(Material.STONE);
- ItemStack salt = SlimefunItems.SALT;
+ ItemStack salt = SlimefunItems.SALT.item();
ItemStack sugar = new ItemStack(Material.SUGAR);
- ItemStack dust = new CustomItemStack(Material.SUGAR, "Dust");
+ ItemStack dust = CustomItemStack.create(Material.SUGAR, "Dust");
assertTrue(isSimilar(nul, nul));
assertTrue(isSimilar(nul, air));
diff --git a/src/test/java/io/github/mooy1/infinitylib/core/MockAddon.java b/src/test/java/io/github/mooy1/infinitylib/core/MockAddon.java
index ba4f425..3b49673 100644
--- a/src/test/java/io/github/mooy1/infinitylib/core/MockAddon.java
+++ b/src/test/java/io/github/mooy1/infinitylib/core/MockAddon.java
@@ -7,7 +7,7 @@
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPluginLoader;
-import be.seeseemelk.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.MockBukkit;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
public class MockAddon extends AbstractAddon {
diff --git a/src/test/java/io/github/mooy1/infinitylib/core/TestAbstractAddon.java b/src/test/java/io/github/mooy1/infinitylib/core/TestAbstractAddon.java
index 1548d4f..4d84665 100644
--- a/src/test/java/io/github/mooy1/infinitylib/core/TestAbstractAddon.java
+++ b/src/test/java/io/github/mooy1/infinitylib/core/TestAbstractAddon.java
@@ -5,14 +5,16 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.ThrowingSupplier;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.ServerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.ServerMock;
+import org.mockbukkit.mockbukkit.command.CommandResult;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
class TestAbstractAddon {
@@ -64,7 +66,8 @@ void testGlobalTick() {
@Test
void testCommand() {
assertNotNull(MockAddon.instance().getAddonCommand());
- server.executeConsole("mockaddon").assertSucceeded();
+ CommandResult result = server.executeConsole("mockaddon");
+ assertTrue(result.hasSucceeded());
}
@Test
diff --git a/src/test/java/io/github/mooy1/infinitylib/core/TestAddonConfig.java b/src/test/java/io/github/mooy1/infinitylib/core/TestAddonConfig.java
index 2fe6b86..5e19ccb 100644
--- a/src/test/java/io/github/mooy1/infinitylib/core/TestAddonConfig.java
+++ b/src/test/java/io/github/mooy1/infinitylib/core/TestAddonConfig.java
@@ -4,7 +4,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.MockBukkit;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
diff --git a/src/test/java/io/github/mooy1/infinitylib/core/TestAddonLive.java b/src/test/java/io/github/mooy1/infinitylib/core/TestAddonLive.java
index 12d49a4..d72d150 100644
--- a/src/test/java/io/github/mooy1/infinitylib/core/TestAddonLive.java
+++ b/src/test/java/io/github/mooy1/infinitylib/core/TestAddonLive.java
@@ -6,8 +6,8 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.plugin.PluginManagerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.plugin.PluginManagerMock;
import io.github.mooy1.otheraddon.MockOtherAddon;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
diff --git a/src/test/java/io/github/mooy1/infinitylib/core/TestAddonTesting.java b/src/test/java/io/github/mooy1/infinitylib/core/TestAddonTesting.java
index 1192618..5016015 100644
--- a/src/test/java/io/github/mooy1/infinitylib/core/TestAddonTesting.java
+++ b/src/test/java/io/github/mooy1/infinitylib/core/TestAddonTesting.java
@@ -8,8 +8,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.function.ThrowingSupplier;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.plugin.PluginManagerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.plugin.PluginManagerMock;
import io.github.mooy1.otheraddon.MockOtherAddon;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
diff --git a/src/test/java/io/github/mooy1/infinitylib/groups/TestGroups.java b/src/test/java/io/github/mooy1/infinitylib/groups/TestGroups.java
index 60b9d21..0ae365b 100644
--- a/src/test/java/io/github/mooy1/infinitylib/groups/TestGroups.java
+++ b/src/test/java/io/github/mooy1/infinitylib/groups/TestGroups.java
@@ -14,9 +14,9 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
-import be.seeseemelk.mockbukkit.ServerMock;
-import be.seeseemelk.mockbukkit.entity.PlayerMock;
+import org.mockbukkit.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.ServerMock;
+import org.mockbukkit.mockbukkit.entity.PlayerMock;
import io.github.mooy1.infinitylib.common.Events;
import io.github.mooy1.infinitylib.core.MockAddon;
import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile;
@@ -59,7 +59,7 @@ void testGroups() throws ExecutionException, InterruptedException {
assertTrue(sub.isRegistered());
assertTrue(sub.isHidden(p));
- assertFalse(multi.isHidden(p));
+ assertFalse(multi.isVisible(p));
assertEquals(sub.getItem(p), p.getOpenInventory().getItem(9));
Events.call(new InventoryClickEvent(p.getOpenInventory(), InventoryType.SlotType.CONTAINER,
diff --git a/src/test/java/io/github/mooy1/infinitylib/machines/TestCraftingBlock.java b/src/test/java/io/github/mooy1/infinitylib/machines/TestCraftingBlock.java
index 19a12f9..eeb0e33 100644
--- a/src/test/java/io/github/mooy1/infinitylib/machines/TestCraftingBlock.java
+++ b/src/test/java/io/github/mooy1/infinitylib/machines/TestCraftingBlock.java
@@ -9,7 +9,7 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
-import be.seeseemelk.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.MockBukkit;
import io.github.mooy1.infinitylib.core.MockAddon;
import io.github.mooy1.infinitylib.groups.SubGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
@@ -39,8 +39,8 @@ public static void load() {
machine = new CraftingBlock(new SubGroup("key", new ItemStack(Material.DIAMOND)),
new SlimefunItemStack("ID", Material.STONE, "name"),
RecipeType.ANCIENT_ALTAR, new ItemStack[0]);
- output = new CustomItemStack(SlimefunItems.SALT, 2);
- input1 = SlimefunItems.COPPER_DUST.clone();
+ output = CustomItemStack.create(SlimefunItems.SALT.item(), 2);
+ input1 = SlimefunItems.COPPER_DUST.item().clone();
input2 = new ItemStack(Material.NETHERITE_BLOCK, 2).clone();
}
diff --git a/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineBlock.java b/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineBlock.java
index 4c16edc..2f43d1f 100644
--- a/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineBlock.java
+++ b/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineBlock.java
@@ -9,7 +9,8 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
-import be.seeseemelk.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.MockBukkit;
+
import io.github.mooy1.infinitylib.core.MockAddon;
import io.github.mooy1.infinitylib.groups.SubGroup;
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
@@ -42,8 +43,8 @@ public static void load() {
machine = new MachineBlock(new SubGroup("key", new ItemStack(Material.DIAMOND)),
new SlimefunItemStack("ID", Material.STONE, "name"),
RecipeType.ANCIENT_ALTAR, new ItemStack[0]);
- output = new CustomItemStack(SlimefunItems.SALT, 2);
- input1 = SlimefunItems.COPPER_DUST;
+ output = CustomItemStack.create(SlimefunItems.SALT.item(), 2);
+ input1 = SlimefunItems.COPPER_DUST.item().clone();
input2 = new ItemStack(Material.NETHERITE_BLOCK, 2);
}
@@ -93,8 +94,8 @@ void testProcess() {
assertEquals(0, input[1].getAmount());
assertNull(machine.getOutput(input));
- input[0] = new CustomItemStack(input2, 4);
- input[1] = new CustomItemStack(input1, 2);
+ input[0] = CustomItemStack.create(input2, 4);
+ input[1] = CustomItemStack.create(input1, 2);
out = machine.getOutput(input);
diff --git a/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineRecipeType.java b/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineRecipeType.java
index 12eec3c..429676b 100644
--- a/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineRecipeType.java
+++ b/src/test/java/io/github/mooy1/infinitylib/machines/TestMachineRecipeType.java
@@ -8,7 +8,8 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
-import be.seeseemelk.mockbukkit.MockBukkit;
+import org.mockbukkit.mockbukkit.MockBukkit;
+
import io.github.mooy1.infinitylib.core.MockAddon;
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;