use of crazypants.enderio.base.item.coordselector.TelepadTarget in project EnderIO by SleepyTrousers.
the class ContainerDialingDevice method doTeleport.
@Override
public IMessage doTeleport(@Nonnull BlockPos telepad, int targetID, boolean initiateTeleport) {
final TileDialingDevice dialer = getTileEntity();
if (dialer != null && dialer.getEnergy().canUseEnergy(CapacitorKey.DIALING_DEVICE_POWER_USE_TELEPORT)) {
TileTelePad tp = BlockEnder.getAnyTileEntitySafe(dialer.getWorld(), telepad, TileTelePad.class);
if (tp != null) {
ArrayList<TelepadTarget> targets = dialer.getTargets();
if (targetID >= 0 && targetID < targets.size()) {
tp.setTarget(targets.get(targetID));
if (initiateTeleport) {
tp.teleportAll();
dialer.getEnergy().useEnergy(CapacitorKey.DIALING_DEVICE_POWER_USE_TELEPORT);
}
}
return new PacketSetTarget(tp, tp.getTarget());
}
}
return null;
}
Aggregations