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;
}
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);
}
}
Aggregations