Search in sources :

Example 1 with Selection

use of com.builtbroken.mc.lib.world.edit.Selection in project Engine by VoltzEngine-Project.

the class SelectionHandler method getSelection.

/**
     * gets the selection of the player, or creates one if none exists.
     * This is mainly so we dont have to deal with NPEs later.
     */
public static Selection getSelection(EntityPlayer player) {
    Selection out = selections.get(player.getCommandSenderName());
    if (out == null) {
        out = new Selection();
        selections.put(player.getCommandSenderName(), out);
    }
    return out;
}
Also used : Selection(com.builtbroken.mc.lib.world.edit.Selection)

Example 2 with Selection

use of com.builtbroken.mc.lib.world.edit.Selection in project Engine by VoltzEngine-Project.

the class ItemSelectionWand method handelSelection.

public static void handelSelection(EntityPlayer player, Location location) {
    if (!location.world().isRemote) {
        Selection select = SelectionHandler.getSelection(player);
        if (player.isSneaking()) {
            select.setPointOne(location.toPos());
            if (Engine.runningAsDev)
                player.addChatComponentMessage(new ChatComponentText(("Point One: " + select)));
        } else {
            select.setPointTwo(location.toPos());
            if (Engine.runningAsDev)
                player.addChatComponentMessage(new ChatComponentText(("Point Two: " + select)));
        }
        SelectionHandler.setSelection(player, select);
    }
}
Also used : Selection(com.builtbroken.mc.lib.world.edit.Selection) ChatComponentText(net.minecraft.util.ChatComponentText)

Aggregations

Selection (com.builtbroken.mc.lib.world.edit.Selection)2 ChatComponentText (net.minecraft.util.ChatComponentText)1