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

Plugin crash on load/reload. #1

Closed
SnowSnakz opened this issue Feb 23, 2023 · 2 comments
Closed

Plugin crash on load/reload. #1

SnowSnakz opened this issue Feb 23, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@SnowSnakz
Copy link
Owner

A user in the discord server reported a crash on plugin load, seemingly related to the config file.

chat-prefix: "&3&l[&bElemental&cFoods&3&l]&7: &f"
unlock-recipes-on-join: true
items:
    chiyopie:
        id: chiyo_pie
        material: PLAYER_HEAD
        show-food-value: true
        texture: f30ee237290dba133da01af5f88b87cce3b94bc40c5089e988852d478fa154a2
        color:
            red: 120
            green: 76
            blue: 58
        display-name: '&6&lChiyos Apple Pie'
        lore:
        - 'Better than your mums'
        commands: # If you have PlaceholderAPI installed, you can use PlaceholderAPI here,
        # otherwise the only placeholder you can use is %player% which will be replaced with the players username.
        # start a command with srv: to execute the command as the server (this will also ignore player permissions)
        - 'srv:effect give %player% minecraft:invisibility 30 1'
        - 'srv:effect give %player% minecraft:resistance 300 2'
        - 'srv:effect give %player% minecraft:health_boost 120 1'
        # try figure out custom effects e.g gather rate
        food-value: 10
        saturation-value: 5
        is-edible: true
        is-edible-when-full: true
        is-drink: false
        is-glowing: false
        sound-pitch-base: 0.85
        sound-pitch-range: 0.15
        instant-eat: false
        crafting-recipe:
            is-shapeless: true
            shape:
            - 'AAA'
            - 'SSS'
            - 'DDD'
            materials:
                A: APPLE
                D: PASTRY_DOUGH
                S: SUGAR
                
    pastrydough:
        id: PASTRY_DOUGH
        material: CLAY_BALL
        show-food-value: true
        color:
            red: 120
            green: 76
            blue: 58
        display-name: '&6&lPastry Dough'
        lore:
        - 'DOH!!!'
        commands:
        food-value: 10
        saturation-value: 5
        is-edible: false
        is-edible-when-full: true
        is-drink: false
        is-glowing: false
        sound-pitch-base: 0.85
        sound-pitch-range: 0.15
        instant-eat: false
        crafting-recipe:
            is-shapeless: true
            shape:
            - 'WWW'
            - 'TBT'
            materials:
                B: WATER_BUCKET
                W: WHEAT
                T: BUTTER
               
    butter:
        id: BUTTER
        material: GOLD_INGOT
        show-food-value: false
        display-name: '&6&lButter'
        lore:
        - 'I can believe it!'
        food-value: 0
        saturation-value: 2.0
        is-edible: false
        is-edible-when-full: true
        is-drink: false
        is-glowing: false
        sound-pitch-base: 0.85
        sound-pitch-range: 0.15
        instant-eat: false
        crafting-recipe:
            is-shapeless: true
            shape:
            - 'S'
            - 'M'
            materials:
                S: STICK
                M: MILK_BUCKET
                
    coffee:
        id: coffee
        material: potion
        show-food-value: false
        color:
            red: 120
            green: 76
            blue: 58
        display-name: '&6&lCoffee'
        lore:
        - 'Energetic.'
        commands:
        - 'srv:effect give %player% minecraft:speed 300 2'
        food-value: 0
        saturation-value: 2.0
        is-edible: true
        is-edible-when-full: true
        is-drink: true
        is-glowing: false
        sound-pitch-base: 0.85
        sound-pitch-range: 0.15
        instant-eat: false
        crafting-recipe:
            is-shapeless: false
            shape:
            - 'SSS'
            - 'CCC'
            - 'WMW'
            materials:
                S: SUGAR
                C: COCOA_BEANS
                M: MILK_BUCKET
                W: WATER_BUCKET
                
    heartystew:
        id: hearty_stew
        material: suspicious_stew
        show-food-value: true
        color:
            red: 120
            green: 76
            blue: 58
        display-name: '&6&lHearty Stew'
        lore:
        - 'Contains real hearts.'
        commands:
        - 'srv:effect give %player% minecraft:slowness 60 2'
        - 'srv:effect give %player% minecraft:regeneration 300 2'
        - 'srv:effect give %player% minecraft:health_boost 180 2'
        - 'srv:effect give %player% minecraft:strength 180 1'
        food-value: 20
        saturation-value: 20
        is-edible: true
        is-edible-when-full: false
        is-drink: false
        is-glowing: false
        sound-pitch-base: 0.85
        sound-pitch-range: 0.15
        instant-eat: false
        crafting-recipe:
            is-shapeless: true
            shape:
            materials:
                W: WATER_BUCKET
                B: BOWL
                C: COOKED_CHICKEN
                S: COOKED_BEEF
                T: CARROT
                P: POTATO
                M: BROWN_MUSHROOM
                E: WHEAT
                F: DANDELION

The first point at which the stacktrace references my source is in ElementalFoods.java at line 333 (com.elementalwoof.foods.ElementalFoods.reload), however line 333 is an empty line and I have verified this by looking at the revision history for that version.

[11:50:51 INFO]: *** issued server command: /foods reload
[11:50:51 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'foods' in plugin ElementalFoods v1.4.0
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
	at org.bukkit.craftbukkit.v1_19_R1.CraftServer.dispatchCommand(CraftServer.java:916) ~[paper-1.19.2.jar:git-Paper-215]
	at org.bukkit.craftbukkit.v1_19_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.19.2.jar:git-Paper-215]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[paper-1.19.2.jar:?]
	at net.minecraft.commands.Commands.performCommand(Commands.java:305) ~[?:?]
	at net.minecraft.commands.Commands.performCommand(Commands.java:289) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2294) ~[?:?]
	at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$20(ServerGamePacketListenerImpl.java:2248) ~[?:?]
	at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
	at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.19.2.jar:git-Paper-215]
	at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
	at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
	at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1341) ~[paper-1.19.2.jar:git-Paper-215]
	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:185) ~[paper-1.19.2.jar:git-Paper-215]
	at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
	at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1318) ~[paper-1.19.2.jar:git-Paper-215]
	at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1311) ~[paper-1.19.2.jar:git-Paper-215]
	at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
	at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1289) ~[paper-1.19.2.jar:git-Paper-215]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1177) ~[paper-1.19.2.jar:git-Paper-215]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:305) ~[paper-1.19.2.jar:git-Paper-215]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalArgumentException: recipeKey == null
	at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-31.0.1-jre.jar:?]
	at org.bukkit.craftbukkit.v1_19_R1.CraftServer.getRecipe(CraftServer.java:1442) ~[paper-1.19.2.jar:git-Paper-215]
	at org.bukkit.Bukkit.getRecipe(Bukkit.java:1015) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
	at com.elementalwoof.foods.ElementalFoods.reload(ElementalFoods.java:333) ~[ElementalFoods.jar:?]
	at com.elementalwoof.foods.FoodsCommand.onCommand(FoodsCommand.java:44) ~[ElementalFoods.jar:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
	... 23 more

I will be trying to find a solution.

@SnowSnakz SnowSnakz added the bug Something isn't working label Feb 23, 2023
@SnowSnakz SnowSnakz self-assigned this Feb 23, 2023
SnowSnakz added a commit that referenced this issue Feb 23, 2023
@SnowSnakz
Copy link
Owner Author

I am not receiving this error on a jar with the patch I just made.
About to test it on the current latest release.
image

@SnowSnakz
Copy link
Owner Author

The patch seems to be working for now, closing the issue.

SnowSnakz added a commit that referenced this issue Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant