Bertware / bukkitgui2

A completely new version of BukkitGUI , which is easier in use, faster, and more powerful
https://dev.bukkit.org/projects/bukkitgui?gameCategorySlug=bukkit-plugins&projectID=32715
Mozilla Public License 2.0
69 stars 25 forks source link

Player inventory editor #50

Open BetaPotato opened 9 years ago

BetaPotato commented 9 years ago

An option like this in the players tab would be useful.

Bertware commented 9 years ago

While this would be useful, this is close to impossible. I can't alter the player data files while the server is running, and using a plugin would make it version and server dependant.

BetaPotato commented 9 years ago

I don't see a good way to do this aside from making several plugin versions, or somehow making a plugin that is universally compatible with all versions. I will reopen this if I find a better way to do it.

spideynn commented 9 years ago

@Bertware You could use the give command instead of directly modifying the player data files, although that might be dependent on the server software.

Bertware commented 9 years ago

That would work, but it's limited to giving items only, not viewing or editing the inventories (which is what @technoguy20000 meant)

BetaPotato commented 9 years ago

I've heard from a plugin developer that the plugin is not version specific if it doesn't have version specific imports, in other words, using only the BukkitAPI

BetaPotato commented 9 years ago

Just by the way, the give command paired with the clear command (/clear [player] [item] [data] [maxCount] [dataTag]) and the .dat file for viewing the inventory, this approach still could work. A plugin would still be better though.

spideynn commented 9 years ago

@Bertware I was thinking about making a plugin for it, since I figured out a way that shouldn't depend on a certain version using the Bukkit Inventory API. How should the information be transferred between the plugin and BukkitGUI?

Bertware commented 9 years ago

The .dat file isn't up to date while the server is running I believe, or it's locked. It might be possible though, although it's not my number one priority. A possible solution would be this:

simon816 commented 9 years ago

I vote a Sponge plugin, since Bukkit will be obsolete in a few months.

It should be an optional extra though.

spideynn commented 9 years ago

@Bertware I tested this on my server, you can modify the .dat while the server is running but the player needs to disconnect before the changes save, or they get overwritten when something happens before the player leaves.

@simon816 I'll do both, but I need to learn the Sponge API first. I know that Glowstone & Spigot use the Bukkit API still. EDIT: Sponge looks a lot like Minecraft Forge modding, so Sponge support may take a while.

Bertware commented 9 years ago

Before y'all start working on plugins or stuff: both glowstone and sponge support is planned or work in progress, but as far as I know they both don't work 100% as they should now. Just a reminder, so you don't get disappointed when you want to test

spideynn commented 9 years ago

I've almost finished the plugin, and here's the output when you do '/bukkitguihelp inventory playername' http://pastebin.com/L8DhNGad I'm just trying to figure out why its adding (0) on the end of the item name, once I fix that the bukkit / spigot plugin is done. EDIT: Found out its not printing out equipped armor, so that needs to be fixed as well. :smiley:

spideynn commented 9 years ago

@Bertware @technoguy20000 Spigot, Bukkit, and Glowstone support for only reading the inventory is available here: https://github.com/spideynn/InventoryAPI-JSON/releases

The way this works is 0-35 are the inventory slots, and 36-39 are the armor slots. I'm working on a diagram for it at the moment. EDIT2: Fixed. https://github.com/spideynn/InventoryAPI-JSON/releases/tag/v0.2.1

Bertware commented 9 years ago

I'm currently fixing up the server support before I'm continuing on this myself (if you know .NET, feel free to create an inventory edit window that takes the console output and player name, shows the inventory, and sends the necessary commands to alter the inventory)

spideynn commented 9 years ago

@Bertware Yeah, I'll see what I can do with it. I just need to look through the codebase to learn how you do things in this.

Bertware commented 9 years ago

You could add it to the MinecraftInterop namespace, a class and a form to edit inventories. I try to put all the forms in the UI folder/namespace, thought addon specific forms are in the corresponding addon folder/namespace. Since this would be globally available in both console and player list, I'd keep it as a global thing