Skip to content

An easy-to-use Spigot library that implements a GUI interface within offhand maps.

Notifications You must be signed in to change notification settings

byteful/MiniMapGUI

Repository files navigation

JitPack Discord

MiniMapGUI

An easy-to-use Spigot library that implements a GUI interface within offhand maps.

Video

YouTube

Maven/Gradle Dependencies

Replace Tag with the latest version. (Latest version is in the Releases tab.)

Gradle

repositories {
  maven { url 'https://jitpack.io' }
}

dependencies {
  implementation 'com.github.byteful:MiniMapGUI:Tag'
}

Maven

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>

<dependency>
  <groupId>com.github.byteful</groupId>
  <artifactId>MiniMapGUI</artifactId>
  <version>Tag</version>
</dependency>

Example Usage

public class WarpGUI extends MiniMapGUI {
  private final JavaPlugin plugin;

  public WarpGUI(JavaPlugin plugin, Player player) {
    super(plugin, player);
    this.plugin = plugin;

    wraparoundStages = false;
  }

  @Override
  public void setup() {
    try {
      addStage(
          0,
          SimpleStage.newBuilder()
              .wraparoundOptions(true)
              .addOption(
                  new ImageOption(
                      getPlayer().getWorld(),
                      new URL("someimgurlink.com/image.png"),
                      gui -> {
                        gui.close();
                        gui.getPlayer().teleport(Bukkit.getWorld("world").getSpawnLocation());
                      }))
              .addOption(
                  new ImageOption(
                      getPlayer().getWorld(),
                      new URL("someimgurlink.com/image2.png"),
                      gui -> {
                        gui.close();
                        gui.getPlayer()
                            .teleport(Bukkit.getWorld("world_nether").getSpawnLocation());
                      }))
              .build());
    } catch (MalformedURLException e) {
      e.printStackTrace();
    }
  }

  @Override
  public void onLeftClick(boolean isSneaking, boolean isClickingBlock) {
    if (getCurrentStage() != null) {
      getCurrentStage().nextOption();
      render();
    }
  }

  @Override
  public void onRightClick(boolean isSneaking, boolean isClickingBlock) {
    selectCurrentOption();
  }
}

About

An easy-to-use Spigot library that implements a GUI interface within offhand maps.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages