CraftBook 3

CraftBook 3

139k Downloads

NPE with var and players able to use var command with the feature disabled.

LadyCailinBot opened this issue ยท 1 comments

commented

CRAFTBOOK-3238 - Reported by mibby

PaperSpigot dev 916 (MC 1.10.2)
CraftBook dev 83

[13:13:17] [Server thread/INFO]: xfallxcuav issued server command: /cb var
[13:13:21] [Server thread/INFO]: xfallxcuav issued server command: /cb var get test
[13:13:21] [Server thread/WARN]: com.sk89q.minecraft.util.commands.WrappedCommandException: java.lang.NullPointerException
[13:13:21] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.invokeMethod(CommandsManager.java:538)
[13:13:21] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:516)
[13:13:21] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:471)
[13:13:21] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:471)
[13:13:21] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.execute(CommandsManager.java:409)
[13:13:21] [Server thread/WARN]: 	at com.sk89q.craftbook.bukkit.CraftBookPlugin.onCommand(CraftBookPlugin.java:767)
[13:13:21] [Server thread/WARN]: 	at com.sk89q.bukkit.util.DynamicPluginCommand.execute(DynamicPluginCommand.java:54)
[13:13:21] [Server thread/WARN]: 	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
[13:13:21] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:672)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(PlayerConnection.java:1396)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1201)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13)
[13:13:21] [Server thread/WARN]: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[13:13:21] [Server thread/WARN]: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:808)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:404)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:740)
[13:13:21] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:639)
[13:13:21] [Server thread/WARN]: 	at java.lang.Thread.run(Thread.java:745)
[13:13:21] [Server thread/WARN]: Caused by: java.lang.NullPointerException
[13:13:21] [Server thread/WARN]: 	at com.sk89q.craftbook.mechanics.variables.VariableCommands.get(VariableCommands.java:87)
[13:13:21] [Server thread/WARN]: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[13:13:21] [Server thread/WARN]: 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[13:13:21] [Server thread/WARN]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[13:13:21] [Server thread/WARN]: 	at java.lang.reflect.Method.invoke(Method.java:498)
[13:13:21] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.invokeMethod(CommandsManager.java:528)
[13:13:21] [Server thread/WARN]: 	... 21 more
[13:13:33] [Server thread/INFO]: xfallxcuav issued server command: /cb var define a
[13:13:36] [Server thread/INFO]: xfallxcuav issued server command: /cb var define a 10
[13:13:36] [Server thread/WARN]: com.sk89q.minecraft.util.commands.WrappedCommandException: java.lang.NullPointerException
[13:13:36] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.invokeMethod(CommandsManager.java:538)
[13:13:36] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:516)
[13:13:36] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:471)
[13:13:36] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.executeMethod(CommandsManager.java:471)
[13:13:36] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.execute(CommandsManager.java:409)
[13:13:36] [Server thread/WARN]: 	at com.sk89q.craftbook.bukkit.CraftBookPlugin.onCommand(CraftBookPlugin.java:767)
[13:13:36] [Server thread/WARN]: 	at com.sk89q.bukkit.util.DynamicPluginCommand.execute(DynamicPluginCommand.java:54)
[13:13:36] [Server thread/WARN]: 	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
[13:13:36] [Server thread/WARN]: 	at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(CraftServer.java:672)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(PlayerConnection.java:1396)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1201)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$1.run(SourceFile:13)
[13:13:36] [Server thread/WARN]: 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[13:13:36] [Server thread/WARN]: 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:808)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:404)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:740)
[13:13:36] [Server thread/WARN]: 	at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:639)
[13:13:36] [Server thread/WARN]: 	at java.lang.Thread.run(Thread.java:745)
[13:13:36] [Server thread/WARN]: Caused by: java.lang.NullPointerException
[13:13:36] [Server thread/WARN]: 	at com.sk89q.craftbook.mechanics.variables.VariableCommands.define(VariableCommands.java:61)
[13:13:36] [Server thread/WARN]: 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[13:13:36] [Server thread/WARN]: 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[13:13:36] [Server thread/WARN]: 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[13:13:36] [Server thread/WARN]: 	at java.lang.reflect.Method.invoke(Method.java:498)
[13:13:36] [Server thread/WARN]: 	at com.sk89q.minecraft.util.commands.CommandsManager.invokeMethod(CommandsManager.java:528)
[13:13:36] [Server thread/WARN]: 	... 21 more

I also do not have the var feature enabled, but players are able to use/type var commands?

    Variables:
        default-to-global: false
        enable-in-console: false
        enable-in-player-commands: false
        enable-in-player-chat: false
        override-all-text: false
enabled-mechanics:
- Bookcase
- Bridge
- Elevator
- Gate
- HiddenSwitch
- SignCopier
- CustomCrafting
- Chairs
- PaintingSwitcher
- Door

# A list of CraftBook mechanics that are disabled, for easy copy/pastability to the enabled list.
disabled-mechanics:
- AI
- Ammeter
- BetterLeads
- BetterPhysics
- BetterPistons
- BetterPlants
- BoatDecay
- BoatDrops
- BoatExitRemover
- BoatRemoveEntities
- BoatSpeedModifiers
- BoatUncrashable
- BoatWaterPlaceOnly
- BounceBlocks
- Cauldron
- ChunkAnchor
- CommandItems
- CommandSigns
- CookingPot
- CustomDrops
- DispenserRecipes
- Footprints
- Glowstone
- HeadDrops
- ICs
- JackOLantern
- Jukebox
- LandBoats
- LegacyCauldron
- LegacyCustomDrops
- LightStone
- LightSwitch
- MapChanger
- Marquee
- MinecartBooster
- MinecartCollisionEntry
- MinecartConstantSpeed
- MinecartDecay
- MinecartDeposit
- MinecartDispenser
- MinecartEjector
- MinecartElevator
- MinecartEmptySlowdown
- MinecartExitRemover
- MinecartFallModifier
- MinecartItemPickup
- MinecartMaxSpeed
- MinecartMessenger
- MinecartMobBlocker
- MinecartMoreRails
- MinecartNoCollide
- MinecartPlaceAnywhere
- MinecartRailPlacer
- MinecartRemoveEntities
- MinecartReverser
- MinecartSorter
- MinecartSpeedModifiers
- MinecartStation
- MinecartTeleporter
- MinecartTemporaryCart
- MinecartVisionSteering
- Netherrack
- Pay
- Pipes
- Snow
- Sponge
- Teleporter
- ToggleArea
- TreeLopper
- Variables
- XPStorer
commented

Comment by me4502

The WorldEdit command system doesn't support adding commands dynamically, which is why they exist even when it's not enabled. However I'll make it give a message about it not being enabled, rather than erroring.