Search in sources :

Example 1 with IDisplayObject

use of au.com.mineauz.minigames.display.IDisplayObject in project Minigames by AddstarMC.

the class RegionDisplayManager method hideAll.

public void hideAll(Player player) {
    MinigamePlayer mplayer = Minigames.plugin.pdata.getMinigamePlayer(player);
    Map<Region, IDisplayObject> regions = regionDisplays.remove(player);
    if (regions != null) {
        for (IDisplayObject display : regions.values()) {
            display.remove();
        }
        for (Region region : regions.keySet()) {
            hideInfo(region, mplayer);
        }
    }
    Map<Node, IDisplayObject> nodes = nodeDisplays.remove(player);
    if (nodes != null) {
        for (IDisplayObject display : nodes.values()) {
            display.remove();
        }
        for (Node node : nodes.keySet()) {
            hideInfo(node, mplayer);
        }
    }
}
Also used : MinigamePlayer(au.com.mineauz.minigames.MinigamePlayer) IDisplayObject(au.com.mineauz.minigames.display.IDisplayObject)

Example 2 with IDisplayObject

use of au.com.mineauz.minigames.display.IDisplayObject in project Minigames by AddstarMC.

the class RegionDisplayManager method show.

public void show(Region region, MinigamePlayer player) {
    Map<Region, IDisplayObject> regions = regionDisplays.get(player.getPlayer());
    if (regions == null) {
        regions = Maps.newIdentityHashMap();
        regionDisplays.put(player.getPlayer(), regions);
    }
    Location[] corners = MinigameUtils.getMinMaxSelection(region.getFirstPoint(), region.getSecondPoint());
    IDisplayObject display = Minigames.plugin.display.displayCuboid(player.getPlayer(), corners[0], corners[1].add(1, 1, 1));
    display.show();
    regions.put(region, display);
    showInfo(region, player);
}
Also used : IDisplayObject(au.com.mineauz.minigames.display.IDisplayObject) Location(org.bukkit.Location)

Example 3 with IDisplayObject

use of au.com.mineauz.minigames.display.IDisplayObject in project Minigames by AddstarMC.

the class RegionDisplayManager method hide.

public void hide(Region region, MinigamePlayer player) {
    Map<Region, IDisplayObject> regions = regionDisplays.get(player.getPlayer());
    if (regions == null) {
        return;
    }
    IDisplayObject display = regions.remove(region);
    if (display != null) {
        display.remove();
    }
    hideInfo(region, player);
}
Also used : IDisplayObject(au.com.mineauz.minigames.display.IDisplayObject)

Example 4 with IDisplayObject

use of au.com.mineauz.minigames.display.IDisplayObject in project Minigames by AddstarMC.

the class RegionDisplayManager method hide.

public void hide(Node node, MinigamePlayer player) {
    Map<Node, IDisplayObject> nodes = nodeDisplays.get(player.getPlayer());
    if (nodes == null) {
        return;
    }
    IDisplayObject display = nodes.remove(node);
    if (display != null) {
        display.remove();
    }
    hideInfo(node, player);
}
Also used : IDisplayObject(au.com.mineauz.minigames.display.IDisplayObject)

Example 5 with IDisplayObject

use of au.com.mineauz.minigames.display.IDisplayObject in project Minigames by AddstarMC.

the class RegionDisplayManager method show.

public void show(Node node, MinigamePlayer player) {
    Map<Node, IDisplayObject> nodes = nodeDisplays.get(player.getPlayer());
    if (nodes == null) {
        nodes = Maps.newIdentityHashMap();
        nodeDisplays.put(player.getPlayer(), nodes);
    }
    IDisplayObject display = Minigames.plugin.display.displayPoint(player.getPlayer(), node.getLocation(), true);
    display.show();
    nodes.put(node, display);
    showInfo(node, player);
}
Also used : IDisplayObject(au.com.mineauz.minigames.display.IDisplayObject)

Aggregations

IDisplayObject (au.com.mineauz.minigames.display.IDisplayObject)5 MinigamePlayer (au.com.mineauz.minigames.MinigamePlayer)1 Location (org.bukkit.Location)1