Hello! I have an issue when I try placing a custom block using the ItemsAdderAPI in my plugin.
Here is the code I use to place the block :
public void generateRandomBlock(Location randomLocation) {
System.out.println("Generating block at " + randomLocation.toString());
CustomBlock.
getInstance
("iasurvival:cassiterite_ore").place(randomLocation);
}
Here is the error I get :
java.lang.NullPointerException: Cannot invoke "dev.lone.itemsadder.api.CustomBlock.place(org.bukkit.Location)" because the return value of "dev.lone.itemsadder.api.CustomBlock.getInstance(String)" is null
at me.tomisanhues2.pmines.data.PrivateMine.generateRandomBlock(PrivateMine.java:251) ~[privatemines-revamped-1.0-SNAPSHOT.jar:?]
at me.tomisanhues2.pmines.data.PrivateMine.fillMine(PrivateMine.java:246) ~[privatemines-revamped-1.0-SNAPSHOT.jar:?]
at me.tomisanhues2.pmines.cache.MineManager.addMine(MineManager.java:28) ~[privatemines-revamped-1.0-SNAPSHOT.jar:?]
at me.tomisanhues2.pmines.cache.MineManager.loadMineData(MineManager.java:37) ~[privatemines-revamped-1.0-SNAPSHOT.jar:?]
at me.tomisanhues2.pmines.cache.MineManager.loadAllMineData(MineManager.java:61) ~[privatemines-revamped-1.0-SNAPSHOT.jar:?]
at me.tomisanhues2.pmines.PrivateMines.onEnable(PrivateMines.java:52) ~[privatemines-revamped-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:287) ~[pufferfish-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:188) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[pufferfish-api-1.20.4-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugin(CraftServer.java:639) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.enablePlugins(CraftServer.java:550) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:672) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:311) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1132) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[pufferfish-1.20.4.jar:git-Pufferfish-51]
at java.lang.Thread.run(Thread.java:840) ~[?:?]
Here are some specifics that might help :
Server version : 1.20.4
Plugin version : ItemsAdder v3.6.4-release-3
API version : latest
If you need any more information, don't hesitate to ask. Thank you! 😁