InputGuiAPI

This project is abandoned and its default file will likely not work with the most recent version of Minecraft. Whether this project is out of date or its author has marked it as abandoned, this project is no longer maintained.

I have found a way to use the command block gui to read strings and using them, I made a small plugin with api for this so multiple plugin should be able to use it and making it a lot easier to use. :) The other text on the gui can be removed by using a modified resource pack. It already uses ProtocolLib to read incomming packets but doesn't use any nms.

Features:

  • Open a input gui and read the input string.
  • Intercept command block renaming.
  • Intercept anvil renaming events. (Including color support.)
  • Force a player to open a sign gui or command block edit gui.

Usefull Links:

Requirements:

How to use?

First you will need to import the api into your plugin build path.
You can also import the dependency using maven:

<dependency>
    <groupId>cybermaxke</groupId>
    <artifactId>inputgui</artifactId>
    <version>dev-SNAPSHOT</version>
</dependency>
<repository>
    <id>cybermaxkes-repo</id>
    <url>http://dl.dropbox.com/u/104060836/mvn-repo</url>
</repository>


Example:

This is how you should be able to get the api:

InputGuiAPI api = (InputGuiAPI) Bukkit.getPluginManager().getPlugin("InputGui");


Now, once you can acces the api, you can make the player opening a gui:

Player player = ...;
InputPlayer iplayer = api.getPlayer(player);
iplayer.openGui(new InputGui() {
    @Override
    public String getDefaultText() {
        return "This is a example!";
    }
    @Override
    public void onConfirm(InputPlayer player, String input) {
        player.getPlayer().sendMessage(this.getDefaultText() + " -> " + input);
    }
    @Override
    public void onCancel(InputPlayer player) {
    }
});

That is everything you need to do!
Please post issues on github.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files

No files uploaded yet.