Fabricio20 / HubBasics

Bukkit Plugin For Hub Owners
GNU Lesser General Public License v3.0
22 stars 11 forks source link

Command "item:ItemName" does not spawn in an item - it just runs the command /ItemName. #162

Closed Thatsmusic99 closed 3 years ago

Thatsmusic99 commented 3 years ago

In example-1.yml, the example item provides a list of example commands that can be run, these being:

Commands:
  - 'me hi' # Executes a command as the player
  - 'op:say Hi' # Executes a command as OP
  - 'console:say Hello' # Executes a command as the console
  - 'msg:CUSTOM_MESSAGE' # Sends a message to the player
  - 'warp:Default'  # Warps to a HubBasics location
  - 'server:Lobby'  # Teleports to another Bungee server
  - 'open:MenuName' # Opens a Menu
  - 'item:ItemName' # Spawns a HubBasics Item

However, according to the source code, the item: option does not actually exist - https://github.com/Fabricio20/HubBasics/blob/9ece9b9c01ce3b219cae2dc0ed54826c4d0246e1/Spigot/src/main/java/net/notfab/hubbasics/spigot/entities/CustomItem.java#L91-L124

To demonstrate the problem, if I have the commands set up like this, and interact with the item...

Commands:
  - 'me hi' # Please replace the command provided with your own!
  - 'item:lobby-bed'
  - 'op:tppos 527 76 554'

It will attempt to run it as a command instead.

Occurs on HubBasics 6.11.8, tested on git-Paper-418 (MC: 1.16.5) and an ancient version of Spigot 1.8.8; both yielded the same results.

Fabricio20 commented 3 years ago

Hey, I'll investigate this tomorrow, should be an easy fix as well.

Fabricio20 commented 3 years ago

Still in time!

This should be fixed on commit f004d5a. This is release 6.11.9 and is already available on SpigotMC.

Thatsmusic99 commented 3 years ago

Apologies, have been caught up in a lot of work recently. Thank you for the rapid fix!