Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical Error. #24

Closed
weihao opened this issue Aug 6, 2018 · 4 comments
Closed

Critical Error. #24

weihao opened this issue Aug 6, 2018 · 4 comments
Assignees
Labels

Comments

@weihao
Copy link

weihao commented Aug 6, 2018

Caused by: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V
at fr.minuskube.inv.opener.ChestInventoryOpener.open(ChestInventoryOpener.java:15) ~[?:?]
at fr.minuskube.inv.SmartInventory.open(SmartInventory.java:56) ~[?:?]
at fr.minuskube.inv.SmartInventory.open(SmartInventory.java:35) ~[?:?]

I tried shading Guava, and everything I could.
But I am still getting this error.

@weihao
Copy link
Author

weihao commented Aug 6, 2018

org.bukkit.command.CommandException: Unhandled exception executing command 'enhance' in plugin EnchantmentsEnhance v5.1.1
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-db6de12-18fbb24]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_111]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_111]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
Caused by: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;I)V
at fr.minuskube.inv.opener.ChestInventoryOpener.open(ChestInventoryOpener.java:15) ~[?:?]
at fr.minuskube.inv.SmartInventory.open(SmartInventory.java:56) ~[?:?]
at fr.minuskube.inv.SmartInventory.open(SmartInventory.java:35) ~[?:?]
at org.pixeltime.enchantmentsenhance.command.player.DebugCommand.onCommand(DebugCommand.kt:47) ~[?:?]
at org.pixeltime.enchantmentsenhance.manager.CommandManager.onCommand(CommandManager.java:134) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
... 15 more

public class MenuProvider implements InventoryProvider {

@Override
public void init(Player player, InventoryContents contents) {
    for (int i = 0; i < 9; i += 2)
        contents.fillColumn(i, ClickableItem.empty(new ItemStack(Material.BEDROCK)));

    contents.set(1, 1, ClickableItem.of(new ItemStack(Material.COMPASS), e -> {
        if (e.isLeftClick()) {
            player.sendMessage(ChatColor.GOLD + "You left clicked on my compass! "
                    + ChatColor.YELLOW + "Here is a carrot, you deserve it.");

            contents.set(1, 1, ClickableItem.empty(new ItemStack(XMaterial.CARROT.parseItem())));
        } else if (e.isRightClick()) {
            player.sendMessage(ChatColor.DARK_RED + "Oh no! The right click was trapped! "
                    + ChatColor.RED + "You found a stick...");

            contents.set(1, 1, ClickableItem.empty(new ItemStack(Material.STICK)));
        }
    }));
}

@Override
public void update(Player player, InventoryContents contents) {
}

public class Menu {
public static SmartInventory getInventory(Player player, InventoryManager invManager) {
return SmartInventory.builder()
.id("main")
.title(ChatColor.RED + "Unclosable inventory!" + player.getName())
.type(InventoryType.CHEST)
.size(6, 9)
.closeable(false)
.provider(new MenuProvider())
.manager(invManager)
.build();
}
}

@MinusKube
Copy link
Owner

It seems like you have a weird Spigot version, mine works correctly 🤔 Try to download the last Spigot 1.8.8 version maybe

@weihao
Copy link
Author

weihao commented Aug 7, 2018

I build my own spigot from latest git commits... A newer version of Guava may be shaded into the build.
I will try to use a stable build.

@MinusKube MinusKube self-assigned this Aug 14, 2018
@MinusKube MinusKube added the bug label Aug 14, 2018
@MinusKube
Copy link
Owner

Okay after some tests, it is clearly an issue from SmartInvs which is present on all 1.8.8 servers, I'll release 1.2.3 to fix that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants