use of crazypants.enderio.machines.machine.teleport.telepad.packet.PacketTargetList in project EnderIO by SleepyTrousers.
the class GuiTargetList method elementClicked.
@Override
protected boolean elementClicked(int elementIndex, boolean doubleClick, int elX, int elY) {
TelepadTarget target = getSelectedElement();
Rectangle iconBounds = getIconBounds(0);
if (iconBounds.contains(elX, elY)) {
PacketHandler.INSTANCE.sendToServer(new PacketTargetList(te, target, false));
if (selectedIndex >= getNumElements()) {
setSelection(getNumElements() - 1);
}
return false;
}
return true;
}
use of crazypants.enderio.machines.machine.teleport.telepad.packet.PacketTargetList in project EnderIO by SleepyTrousers.
the class TileDialingDevice method processTasks.
@Override
public boolean processTasks(boolean redstoneCheck) {
getEnergy().useEnergy();
if (!getInventory().getSlot("INPUT").isEmpty() && getInventory().getSlot("OUTPUT").isEmpty() && getEnergy().useEnergy(CapacitorKey.DIALING_DEVICE_POWER_USE_PAPER)) {
ItemStack stack = getInventory().getSlot("INPUT").get();
TelepadTarget newTarg = TelepadTarget.readFromNBT(stack);
if (newTarg != null && !targets.contains(newTarg)) {
addTarget(newTarg);
PacketHandler.sendToAllAround(new PacketTargetList(this, newTarg, true), this);
}
getInventory().getSlot("INPUT").clear();
getInventory().getSlot("OUTPUT").set(stack);
}
return false;
}
Aggregations